Use 1.x preference abstraction (#8020)
* Use 1.x preference abstraction - Uses SharedPreferences compared to 1.x impl which uses DataStore but it breaks all settings screens currently - Move PreferencesHelper to new PreferenceStore - PreferencesHelper should be split into smaller preference stores and be in core or domain - Remove flow preferences as new PreferenceStore handles changes for us Co-authored-by: inorichi <3521738+inorichi@users.noreply.github.com> * Fix PreferenceMutableState not updating * Fix changes not emitting on first subscription Co-authored-by: inorichi <3521738+inorichi@users.noreply.github.com>
This commit is contained in:
@@ -69,9 +69,9 @@ abstract class TrackService(val id: Long) {
|
||||
get() = getUsername().isNotEmpty() &&
|
||||
getPassword().isNotEmpty()
|
||||
|
||||
fun getUsername() = preferences.trackUsername(this)!!
|
||||
fun getUsername() = preferences.trackUsername(this).get()
|
||||
|
||||
fun getPassword() = preferences.trackPassword(this)!!
|
||||
fun getPassword() = preferences.trackPassword(this).get()
|
||||
|
||||
fun saveCredentials(username: String, password: String) {
|
||||
preferences.setTrackCredentials(this, username, password)
|
||||
|
||||
@@ -99,6 +99,6 @@ class MangaUpdates(private val context: Context, id: Long) : TrackService(id) {
|
||||
}
|
||||
|
||||
fun restoreSession(): String? {
|
||||
return preferences.trackPassword(this)
|
||||
return preferences.trackPassword(this).get()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user