Skip to content

Commit

Permalink
Disable sync only until update
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Aug 19, 2023
1 parent 7b5498c commit 7085523
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/src/main/java/net/bible/service/cloudsync/CloudSync.kt
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ object CloudSync {
DatabaseContainer.databaseAccessorFactories.asyncMap {
val dbDef = it.invoke()
if(!dbDef.category.enabled) return@asyncMap
if(dbDef.dao.getLong("disabledForVersion") == dbDef.version.toLong()) return@asyncMap
try {
initializeSync(dbDef)
} catch (e: CancelStartedSync) {
Expand Down Expand Up @@ -392,7 +393,7 @@ object CloudSync {
Log.e(TAG, "downloadAndApplyNewPatches failed due to IOException", e)
} catch (e: IncompatiblePatchVersion) {
ABEventBus.post(BibleApplication.ErrorNotificationEvent(cantFetchString(dbDef.category.contentDescription), showReportButton = false))
dbDef.category.enabled = false
dbDef.dao.setConfig("disabledForVersion", dbDef.version.toLong())
return@asyncMap
} catch (e: Exception) {
Log.e(TAG, "downloadAndApplyNewPatches failed due to error", e)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@
<string name="are_you_sure_reset_cloud">This will reset your cloud database for %s with the content that you have in this device.</string>
<string name="sync_cant_fetch">The version of database or patch file stored in Cloud is higher than the one supported by this app. </string>
<string name="sync_disabling">Disabling synchronizing for %s for now.</string>
<string name="sync_update_app">Please update the app and then re-enable synchronization.</string>
<string name="sync_update_app">Please update the app to continue synchronization.</string>
<string name="sign_in_failed">Signing in to synchronization backend service failed.</string>
<string name="disabling_sync">Disabling cloud synchronizing. You must re-enable manually after restore.</string>
<string name="report">Report</string>
Expand Down

0 comments on commit 7085523

Please sign in to comment.