1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Mobile: Fixed issue that could slow down app when displaying large list of notes

This commit is contained in:
Laurent Cozic
2019-07-13 23:55:28 +01:00
parent 0255546ae1
commit bdb31f2890
2 changed files with 26 additions and 12 deletions

View File

@@ -100,15 +100,15 @@ class NotesScreenComponent extends BaseScreenComponent {
AppState.removeEventListener('change', this.onAppStateChange_);
}
async UNSAFE_componentWillReceiveProps(newProps) {
if (newProps.notesOrder !== this.props.notesOrder ||
newProps.selectedFolderId != this.props.selectedFolderId ||
newProps.selectedTagId != this.props.selectedTagId ||
newProps.selectedSmartFilterId != this.props.selectedSmartFilterId ||
newProps.notesParentType != this.props.notesParentType) {
await this.refreshNotes(newProps);
async componentDidUpdate(prevProps) {
if (prevProps.notesOrder !== this.props.notesOrder ||
prevProps.selectedFolderId != this.props.selectedFolderId ||
prevProps.selectedTagId != this.props.selectedTagId ||
prevProps.selectedSmartFilterId != this.props.selectedSmartFilterId ||
prevProps.notesParentType != this.props.notesParentType) {
await this.refreshNotes(this.props);
}
}
}
async refreshNotes(props = null) {
if (props === null) props = this.props;
@@ -144,6 +144,8 @@ class NotesScreenComponent extends BaseScreenComponent {
notes: notes,
notesSource: source,
});
console.info('Done', Date.now() - startTime);
}
deleteFolder_onPress(folderId) {