Skip to content

Commit

Permalink
Remove nullable folder path
Browse files Browse the repository at this point in the history
Change-Id: Ie64e4057378018aea78500c4071861fbbdc70095
  • Loading branch information
lihenggui committed Jan 16, 2023
1 parent 161e8c3 commit 8fe58e0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ data class UserPreferenceData(
val darkThemeConfig: DarkThemeConfig,
val controllerType: ControllerType,
val ruleServerProvider: RuleServerProvider,
val ruleBackupFolder: String?,
val ruleBackupFolder: String,
val backupSystemApp: Boolean,
val restoreSystemApp: Boolean,
val showSystemApps: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class SettingsViewModel @Inject constructor(
data class UserEditableSettings(
val controllerType: ControllerType = IFW,
val ruleServerProvider: RuleServerProvider = GITLAB,
val ruleBackupFolder: String? = null,
val ruleBackupFolder: String = "",
val backupSystemApp: Boolean = false,
val restoreSystemApp: Boolean = false,
val showSystemApps: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import com.merxury.blocker.feature.settings.R.string
fun BackupSettings(
backupSystemApps: Boolean,
restoreSystemApp: Boolean,
ruleBackupFolder: String?,
ruleBackupFolder: String,
updateBackupSystemApp: (Boolean) -> Unit,
updateRestoreSystemApp: (Boolean) -> Unit,
updateRuleBackupFolder: (String) -> Unit,
Expand All @@ -47,8 +47,9 @@ fun BackupSettings(
SettingItem(
icon = BlockerIcons.Folder,
itemRes = string.folder_to_save,
itemValue = ruleBackupFolder
?: stringResource(id = string.directory_invalid_or_not_set),
itemValue = ruleBackupFolder.ifEmpty {
stringResource(id = string.directory_invalid_or_not_set)
},
onItemClick = {}
)
SwitchSettingItem(
Expand Down

0 comments on commit 8fe58e0

Please sign in to comment.