diff --git a/app/src/main/java/eu/kanade/tachiyomi/App.kt b/app/src/main/java/eu/kanade/tachiyomi/App.kt index 8434071df..9a4e6e1f6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/App.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/App.kt @@ -137,6 +137,13 @@ class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory { if (!LogcatLogger.isInstalled && networkPreferences.verboseLogging().get()) { LogcatLogger.install(AndroidLogcatLogger(LogPriority.VERBOSE)) } + + + val syncPreferences: SyncPreferences by injectLazy() + val syncFlags = syncPreferences.syncFlags().get() + if (syncPreferences.isSyncEnabled() && syncFlags and SyncPreferences.Flags.SYNC_ON_APP_START == SyncPreferences.Flags.SYNC_ON_APP_START) { + SyncDataJob.startNow(this@App) + } } override fun newImageLoader(): ImageLoader { @@ -173,7 +180,7 @@ class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory { val syncPreferences: SyncPreferences by injectLazy() val syncFlags = syncPreferences.syncFlags().get() - if (syncPreferences.syncService().get() != 0 && syncFlags and SyncPreferences.Flags.SYNC_ON_APP_START == SyncPreferences.Flags.SYNC_ON_APP_START) { + if (syncPreferences.isSyncEnabled() && syncFlags and SyncPreferences.Flags.SYNC_ON_APP_RESUME == SyncPreferences.Flags.SYNC_ON_APP_RESUME) { SyncDataJob.startNow(this@App) } }