Skip to content

Commit

Permalink
Merge pull request #310 from tsunami0ne/fix-camera-perm-bug
Browse files Browse the repository at this point in the history
Fix issue with updating some browser settings causing the camera permissions pref to get overwritten
  • Loading branch information
thanksmister authored Aug 30, 2021
2 parents 9537950 + f1f489e commit 31010d0
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 31010d0

Please sign in to comment.