Skip to content

Commit

Permalink
Fix issue with updating some browser settings causing the camera perm…
Browse files Browse the repository at this point in the history
…issions pref to get overwritten
  • Loading branch information
tsunami0ne committed Aug 28, 2021
1 parent 9537950 commit f1f489e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,16 +365,17 @@ constructor(private val context: Context, private val sharedPreferences: SharedP
}

fun hasSettingsUpdates(): Boolean {
val updates = sharedPreferences.getBoolean(PREF_CAMERA_PERMISSIONS, false)
sharedPreferences.edit().putBoolean(PREF_CAMERA_PERMISSIONS, false).apply()
val updates = sharedPreferences.getBoolean(PREF_BROWSER_SETTINGS_UPDATED, false)
sharedPreferences.edit().putBoolean(PREF_BROWSER_SETTINGS_UPDATED, false).apply()
return updates
}

private fun settingsUpdated() {
sharedPreferences.edit().putBoolean(PREF_CAMERA_PERMISSIONS, true).apply()
sharedPreferences.edit().putBoolean(PREF_BROWSER_SETTINGS_UPDATED, true).apply()
}

companion object {
private const val PREF_BROWSER_SETTINGS_UPDATED = "pref_browser_settings_updated"
private const val PREF_DARK_THEME = "pref_dark_theme"
private const val PREF_FULL_SCREEN = "pref_full_screen"
private const val PREF_SETTINGS_CODE = "pref_settings_code"
Expand Down

0 comments on commit f1f489e

Please sign in to comment.