Use 'commit' method to write shared prefs (#154)

This commit is contained in:
BinTianqi
2025-08-18 13:32:12 +08:00
parent c7396eccf7
commit b3d746083f
3 changed files with 5 additions and 5 deletions

View File

@@ -347,7 +347,7 @@ fun NotificationsScreen(onNavigateUp: () -> Unit) = MyScaffold(R.string.notifica
NotificationUtils.ID.SYSTEM_UPDATE_PENDING to R.string.system_update_pending
)
map.forEach { (k, v) ->
SwitchItem(v, getState = { sp.getBoolean("n_$k", true) }, onCheckedChange = { sp.edit { putBoolean("n_$k", it) } })
SwitchItem(v, getState = { sp.getBoolean("n_$k", true) }, onCheckedChange = { sp.edit(true) { putBoolean("n_$k", it) } })
}
}