Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
Lock syncing until initial data load
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed May 12, 2019
1 parent 62b04a1 commit dd3ac05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/screens/ComponentView.js
Expand Up @@ -50,7 +50,7 @@ export default class ComponentView extends Component {
componentDidMount() {
if(Platform.OS == "android" && Platform.Version <= 23) {
// postMessage doesn't work on Android <= 6 (API version 23) https://github.com/facebook/react-native/issues/11594
Alert.alert('Editors Not Supported', `Your version of Android does not support web editors. Changes you make may not be properly saved. Please switch to the Plain Editor for the best experience.`, [{text: 'OK'}])
Alert.alert('Editors Not Supported', `Web editors require Android 7.0 or greater. Your version does not support web editors. Changes you make may not be properly saved. Please switch to the Plain Editor for the best experience.`, [{text: 'OK'}])
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/screens/Root.js
Expand Up @@ -163,6 +163,9 @@ export default class Root extends Abstract {
}

initializeData() {
// Ensure no sync executes until initial data load
Sync.get().lockSyncing();

let encryptionEnabled = KeysManager.get().isOfflineEncryptionEnabled();
this.setSubTitle(encryptionEnabled ? "Decrypting items..." : "Loading items...");
let incrementalCallback = (current, total) => {
Expand All @@ -176,6 +179,7 @@ export default class Root extends Abstract {
}

let loadLocalCompletion = (items) => {
Sync.get().unlockSyncing();
this.setSubTitle("Syncing...");
this.dataLoaded = true;
// perform initial sync
Expand Down

0 comments on commit dd3ac05

Please sign in to comment.