mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Don't allow setting blank user agent string
This commit is contained in:
parent
8d4e812b3d
commit
dea47baff1
1 changed files with 7 additions and 1 deletions
|
@ -45,7 +45,13 @@ class EditTextResetPreference @JvmOverloads constructor(
|
|||
notifyChanged()
|
||||
}
|
||||
this.setPositiveButton(android.R.string.ok) { _, _ ->
|
||||
sharedPreferences?.edit { putString(key, textView.text.toString()) }
|
||||
sharedPreferences?.edit {
|
||||
if (textView.text.isNullOrBlank()) {
|
||||
remove(key)
|
||||
} else {
|
||||
putString(key, textView.text.toString())
|
||||
}
|
||||
}
|
||||
callChangeListener(textView.text.toString())
|
||||
notifyChanged()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue