Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
6243b68
Try to fix performance
djorkaeffalexandre Jul 19, 2019
b043f9a
Add slice to fix crash memory
djorkaeffalexandre Jul 19, 2019
df66504
Remove sort and group by type
djorkaeffalexandre Jul 19, 2019
2346f57
Remove slice
djorkaeffalexandre Jul 19, 2019
796dea4
Fix memory on search
djorkaeffalexandre Jul 19, 2019
92ed265
Update code
djorkaeffalexandre Jul 19, 2019
68a7e24
Minor fixes
djorkaeffalexandre Jul 19, 2019
f2f83d8
Add border bottom to flatlist content
djorkaeffalexandre Jul 19, 2019
818dfb4
Add cancel button to search
djorkaeffalexandre Jul 20, 2019
59d90d0
Remove unnecessary socket
djorkaeffalexandre Jul 20, 2019
c943f88
Add loading while get subscriptions
djorkaeffalexandre Jul 20, 2019
fc171b6
Fix can upload file on Share Extension
djorkaeffalexandre Jul 22, 2019
6174761
Allow change server on file not allowed
djorkaeffalexandre Jul 22, 2019
4913d9b
Fix loading if error on upload media
djorkaeffalexandre Jul 22, 2019
356e7be
Remove debounce
djorkaeffalexandre Jul 22, 2019
95b7395
Fix infinity loading
djorkaeffalexandre Jul 22, 2019
6d3f6b6
Fix cancel button translate
djorkaeffalexandre Jul 22, 2019
662225d
Fix error on get userId - Share Extension
djorkaeffalexandre Jul 22, 2019
377edac
Fix share message
djorkaeffalexandre Jul 22, 2019
a88b811
Improve share extension init
djorkaeffalexandre Jul 22, 2019
7de1e90
Update code
djorkaeffalexandre Jul 22, 2019
22a07aa
Fix login sdk
djorkaeffalexandre Jul 22, 2019
5c8c3d8
Add search on header
djorkaeffalexandre Jul 22, 2019
0c34978
Fix padding on notch devices
djorkaeffalexandre Jul 22, 2019
c9b467a
Fix search after click on item
djorkaeffalexandre Jul 22, 2019
125acfd
Improve clear search
djorkaeffalexandre Jul 22, 2019
71092d6
Update schemaVersion
djorkaeffalexandre Jul 22, 2019
fb4a4b9
Refactor header share list
djorkaeffalexandre Jul 22, 2019
5688a8f
Improve setSearch
djorkaeffalexandre Jul 22, 2019
9070afa
Remove react-native-iphone-x-helper
djorkaeffalexandre Jul 22, 2019
b50721f
Improve search
djorkaeffalexandre Jul 22, 2019
9d6b008
Adjust some styles
djorkaeffalexandre Jul 22, 2019
9196270
Merge branch 'develop' into fix.share-extension-performance
diegolmello Jul 23, 2019
a7faf45
Change deployment target & bump version & change device compatibility
djorkaeffalexandre Jul 23, 2019
c0f3aee
Merge branch 'fix.share-extension-performance' of https://github.com/…
djorkaeffalexandre Jul 23, 2019
08d50be
Upgrade rn-extension-share
djorkaeffalexandre Jul 24, 2019
027c3b4
If there's no current token, show OutsideStack
diegolmello Jul 24, 2019
479020e
Missing translation
diegolmello Jul 24, 2019
ee7b304
Change from "Select channels" to "Send to..."
diegolmello Jul 24, 2019
46d0ef6
Enabled `canSend` as default
diegolmello Jul 24, 2019
4872bfa
Increase server icon size to align server label with channels labels
diegolmello Jul 24, 2019
15ce435
Android search header as React.memo
diegolmello Jul 24, 2019
f402ab5
Cancel search on Android back press
diegolmello Jul 24, 2019
aaa6576
Refactor
diegolmello Jul 24, 2019
a67307e
StatusBar
diegolmello Jul 24, 2019
0d520c4
Fix server change
diegolmello Jul 24, 2019
791ead2
Migrate Share Extension methods to external classes because android r…
djorkaeffalexandre Jul 25, 2019
04fcd0c
Merge
djorkaeffalexandre Jul 25, 2019
20c1918
Fix send file message
djorkaeffalexandre Jul 25, 2019
a91b191
Improve code
djorkaeffalexandre Jul 25, 2019
d0d0b81
Fix multiple logins android
djorkaeffalexandre Jul 26, 2019
6b7bc65
Change params to sendMessage
djorkaeffalexandre Jul 26, 2019
9e06611
Change params to sendFileMessage
djorkaeffalexandre Jul 26, 2019
5cba5d9
Fix problem on sendFileMessage
djorkaeffalexandre Jul 26, 2019
294a139
Fix file size
djorkaeffalexandre Jul 26, 2019
616dc7d
Change react-native-realm-path to podfile
djorkaeffalexandre Jul 26, 2019
c159f27
Change rn-extensions-share to Podfile
djorkaeffalexandre Jul 26, 2019
b018644
Upgrade rn-extensions-share
djorkaeffalexandre Jul 26, 2019
57c94a2
Fix error on canUploadFile
djorkaeffalexandre Jul 27, 2019
54c7afa
Improve code
djorkaeffalexandre Jul 27, 2019
583d18c
Fix error when you try to upload a invalid file
djorkaeffalexandre Jul 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions app/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,30 @@ import { Provider } from 'react-redux';
import Navigation from './lib/Navigation';
import store from './lib/createStore';
import { appInit } from './actions';
import ShareListView from './views/ShareListView';
import ShareView from './views/ShareView';
import SelectServerView from './views/SelectServerView';
import AuthLoadingView from './views/AuthLoadingView';
import WithoutServersView from './views/WithoutServersView';
import sharedStyles from './views/Styles';
import { isNotch } from './utils/deviceInfo';
import { defaultHeader, onNavigationStateChange } from './utils/navigation';


const InsideNavigator = createStackNavigator({
ShareListView,
ShareView,
SelectServerView
ShareListView: {
getScreen: () => require('./views/ShareListView').default
},
ShareView: {
getScreen: () => require('./views/ShareView').default
},
SelectServerView: {
getScreen: () => require('./views/SelectServerView').default
}
}, {
initialRouteName: 'ShareListView',
defaultNavigationOptions: defaultHeader
});

const OutsideNavigator = createStackNavigator({
WithoutServersView
WithoutServersView: {
getScreen: () => require('./views/WithoutServersView').default
}
}, {
initialRouteName: 'WithoutServersView',
defaultNavigationOptions: defaultHeader
Expand All @@ -35,7 +38,9 @@ const OutsideNavigator = createStackNavigator({
const AppContainer = createAppContainer(createSwitchNavigator({
OutsideStack: OutsideNavigator,
InsideStack: InsideNavigator,
AuthLoading: AuthLoadingView
AuthLoading: {
getScreen: () => require('./views/AuthLoadingView').default
}
},
{
initialRouteName: 'AuthLoading'
Expand Down
59 changes: 7 additions & 52 deletions app/views/ShareListView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ const keyExtractor = item => item.rid;
loading: state.server.loading,
FileUpload_MediaTypeWhiteList: state.settings.FileUpload_MediaTypeWhiteList,
FileUpload_MaxFileSize: state.settings.FileUpload_MaxFileSize,
baseUrl: state.settings.baseUrl || state.server ? state.server.server : '',
sortBy: state.sortPreferences.sortBy,
groupByType: state.sortPreferences.groupByType,
showFavorites: state.sortPreferences.showFavorites
baseUrl: state.settings.baseUrl || state.server ? state.server.server : ''
}), dispatch => ({
openSearchHeader: () => dispatch(openSearchHeaderAction()),
closeSearchHeader: () => dispatch(closeSearchHeaderAction())
Expand Down Expand Up @@ -97,9 +94,6 @@ export default class ShareListView extends React.Component {
baseUrl: PropTypes.string,
token: PropTypes.string,
userId: PropTypes.string,
sortBy: PropTypes.string,
groupByType: PropTypes.bool,
showFavorites: PropTypes.bool,
loading: PropTypes.bool
}

Expand All @@ -114,20 +108,12 @@ export default class ShareListView extends React.Component {
loading: true,
fileInfo: null,
search: [],
discussions: [],
channels: [],
favorites: [],
chats: [],
privateGroup: [],
direct: [],
livechat: [],
servers: []
};
}

async componentDidMount() {
this.getSubscriptions();

const { navigation } = this.props;
navigation.setParams({
initSearchingAndroid: this.initSearchingAndroid,
Expand Down Expand Up @@ -203,38 +189,19 @@ export default class ShareListView extends React.Component {
this.data.removeAllListeners();
}

const {
server, sortBy, showFavorites, groupByType
} = this.props;
const { serversDB } = database.databases;
const { server } = this.props;

if (server) {
this.data = database.objects('subscriptions').filtered('archived != true && open == true');
if (sortBy === 'alphabetical') {
this.data = this.data.sorted('name', false);
} else {
this.data = this.data.sorted('roomUpdatedAt', true);
}

// servers
this.servers = serversDB.objects('servers');

// favorites
if (showFavorites) {
this.favorites = this.data.filtered('f == true');
} else {
this.favorites = [];
}
// chats
this.data = this.data.sorted('roomUpdatedAt', true);
this.chats = this.data.slice(0, 50);

// type
if (groupByType) {
this.discussions = this.data.filtered('prid != null');
this.channels = this.data.filtered('t == $0 AND prid == null', 'c');
this.privateGroup = this.data.filtered('t == $0 AND prid == null', 'p');
this.direct = this.data.filtered('t == $0 AND prid == null', 'd');
this.livechat = this.data.filtered('t == $0 AND prid == null', 'l');
} else {
this.chats = this.data;
}
safeAddListener(this.data, this.updateState);
}
}, 300);
Expand All @@ -246,12 +213,6 @@ export default class ShareListView extends React.Component {
this.updateStateInteraction = InteractionManager.runAfterInteractions(() => {
this.internalSetState({
chats: this.chats ? this.chats.slice() : [],
favorites: this.favorites ? this.favorites.slice() : [],
discussions: this.discussions ? this.discussions.slice() : [],
channels: this.channels ? this.channels.slice() : [],
privateGroup: this.privateGroup ? this.privateGroup.slice() : [],
direct: this.direct ? this.direct.slice() : [],
livechat: this.livechat ? this.livechat.slice() : [],
servers: this.servers ? this.servers.slice() : [],
loading: false
});
Expand Down Expand Up @@ -413,7 +374,7 @@ export default class ShareListView extends React.Component {

renderContent = () => {
const {
discussions, channels, privateGroup, direct, livechat, search, chats, favorites
search, chats
} = this.state;

if (search.length > 0) {
Expand All @@ -438,12 +399,6 @@ export default class ShareListView extends React.Component {
return (
<View style={styles.content}>
{this.renderServerSelector()}
{this.renderSection(favorites, 'Favorites')}
{this.renderSection(discussions, 'Discussions')}
{this.renderSection(channels, 'Channels')}
{this.renderSection(direct, 'Direct_Messages')}
{this.renderSection(privateGroup, 'Private_Groups')}
{this.renderSection(livechat, 'Livechat')}
{this.renderSection(chats, 'Chats')}
</View>
);
Expand Down