mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-26 12:00:41 +01:00 
			
		
		
		
	Revert "refactor: remove the none/off choice default to google drive."
This reverts commit c0d43590ad.
			
			
This commit is contained in:
		| @@ -86,8 +86,9 @@ object SettingsBackupAndSyncScreen : SearchableSettings { | ||||
|                         pref = syncPreferences.syncService(), | ||||
|                         title = stringResource(R.string.pref_sync_service), | ||||
|                         entries = mapOf( | ||||
|                             SyncManager.SyncService.GOOGLE_DRIVE.value to stringResource(R.string.google_drive), | ||||
|                             SyncManager.SyncService.NONE.value to stringResource(R.string.off), | ||||
|                             SyncManager.SyncService.SYNCYOMI.value to stringResource(R.string.syncyomi), | ||||
|                             SyncManager.SyncService.GOOGLE_DRIVE.value to stringResource(R.string.google_drive), | ||||
|                         ), | ||||
|                         onValueChanged = { true }, | ||||
|                     ), | ||||
| @@ -423,12 +424,15 @@ object SettingsBackupAndSyncScreen : SearchableSettings { | ||||
|     private fun getSyncServicePreferences(syncPreferences: SyncPreferences, syncService: Int): List<Preference> { | ||||
|         val syncServiceType = SyncManager.SyncService.fromInt(syncService) | ||||
|         return when (syncServiceType) { | ||||
|             SyncManager.SyncService.NONE -> emptyList() | ||||
|             SyncManager.SyncService.SYNCYOMI -> getSelfHostPreferences(syncPreferences) | ||||
|             SyncManager.SyncService.GOOGLE_DRIVE -> getGoogleDrivePreferences() | ||||
|             else -> { | ||||
|         } + | ||||
|             if (syncServiceType == SyncManager.SyncService.NONE) { | ||||
|                 emptyList() | ||||
|             } else { | ||||
|                 listOf(getSyncNowPref(), getAutomaticSyncGroup(syncPreferences)) | ||||
|             } | ||||
|         } + listOf(getSyncNowPref(), getAutomaticSyncGroup(syncPreferences)) | ||||
|     } | ||||
|  | ||||
|     @Composable | ||||
|   | ||||
| @@ -57,12 +57,13 @@ class SyncManager( | ||||
|     private val backupRestorer: BackupRestorer = BackupRestorer(context, backupNotify) | ||||
|  | ||||
|     enum class SyncService(val value: Int) { | ||||
|         GOOGLE_DRIVE(1), | ||||
|         SYNCYOMI(2), | ||||
|         NONE(0), | ||||
|         SYNCYOMI(1), | ||||
|         GOOGLE_DRIVE(2), | ||||
|         ; | ||||
|  | ||||
|         companion object { | ||||
|             fun fromInt(value: Int) = entries.firstOrNull { it.value == value } ?: 1 | ||||
|             fun fromInt(value: Int) = values().firstOrNull { it.value == value } ?: NONE | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user