mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 13:57:57 +01:00 
			
		
		
		
	feat: add a way to reset last sync.
This commit is contained in:
		| @@ -24,6 +24,7 @@ import cafe.adriel.voyager.navigator.LocalNavigator | ||||
| import cafe.adriel.voyager.navigator.currentOrThrow | ||||
| import eu.kanade.domain.base.BasePreferences | ||||
| import eu.kanade.domain.extension.interactor.TrustExtension | ||||
| import eu.kanade.domain.sync.SyncPreferences | ||||
| import eu.kanade.presentation.more.settings.Preference | ||||
| import eu.kanade.presentation.more.settings.screen.advanced.ClearDatabaseScreen | ||||
| import eu.kanade.presentation.more.settings.screen.debug.DebugInfoScreen | ||||
| @@ -124,6 +125,7 @@ object SettingsAdvancedScreen : SearchableSettings { | ||||
|             getNetworkGroup(networkPreferences = networkPreferences), | ||||
|             getLibraryGroup(), | ||||
|             getExtensionsGroup(basePreferences = basePreferences), | ||||
|             getSyncGroup(), | ||||
|         ) | ||||
|     } | ||||
|  | ||||
| @@ -384,4 +386,23 @@ object SettingsAdvancedScreen : SearchableSettings { | ||||
|             ), | ||||
|         ) | ||||
|     } | ||||
|  | ||||
|     @Composable | ||||
|     private fun getSyncGroup(): Preference.PreferenceGroup { | ||||
|         val context = LocalContext.current | ||||
|         val syncPreferences = remember { Injekt.get<SyncPreferences>() } | ||||
|         return Preference.PreferenceGroup( | ||||
|             title = stringResource(MR.strings.label_sync), | ||||
|             preferenceItems = persistentListOf( | ||||
|                 Preference.PreferenceItem.TextPreference( | ||||
|                     title = stringResource(MR.strings.pref_reset_sync_timestamp), | ||||
|                     subtitle = stringResource(MR.strings.pref_reset_sync_timestamp_subtitle), | ||||
|                     onClick = { | ||||
|                         syncPreferences.lastSyncTimestamp().set(0) | ||||
|                         context.toast(MR.strings.success_reset_sync_timestamp) | ||||
|                     }, | ||||
|                 ), | ||||
|             ), | ||||
|         ) | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,4 +1,3 @@ | ||||
|  | ||||
| package eu.kanade.presentation.more.settings.screen.data | ||||
|  | ||||
| import android.content.Context | ||||
|   | ||||
		Reference in New Issue
	
	Block a user