mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-15 15:02:49 +01:00
feat: Add on create so it just does it once when app launches.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
This commit is contained in:
parent
f1f07c187d
commit
4396c012c6
@ -137,6 +137,13 @@ class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory {
|
|||||||
if (!LogcatLogger.isInstalled && networkPreferences.verboseLogging().get()) {
|
if (!LogcatLogger.isInstalled && networkPreferences.verboseLogging().get()) {
|
||||||
LogcatLogger.install(AndroidLogcatLogger(LogPriority.VERBOSE))
|
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 {
|
override fun newImageLoader(): ImageLoader {
|
||||||
@ -173,7 +180,7 @@ class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory {
|
|||||||
|
|
||||||
val syncPreferences: SyncPreferences by injectLazy()
|
val syncPreferences: SyncPreferences by injectLazy()
|
||||||
val syncFlags = syncPreferences.syncFlags().get()
|
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)
|
SyncDataJob.startNow(this@App)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user