Cache locked state of connected accounts (#3790)
Small improvement to the behavior on bad/disconnected networks Fixes https://github.com/tuskyapp/Tusky/issues/3773
This commit is contained in:
parent
1bdf19407c
commit
ee711598c7
7 changed files with 1027 additions and 19 deletions
|
|
@ -100,7 +100,11 @@ data class AccountEntity(
|
|||
* ID of the status at the top of the visible list in the home timeline when the
|
||||
* user navigated away.
|
||||
*/
|
||||
var lastVisibleHomeTimelineStatusId: String? = null
|
||||
var lastVisibleHomeTimelineStatusId: String? = null,
|
||||
|
||||
/** true if the connected Mastodon account is locked (has to manually approve all follow requests **/
|
||||
@ColumnInfo(defaultValue = "0")
|
||||
var locked: Boolean = false
|
||||
) {
|
||||
|
||||
val identifier: String
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@ class AccountManager @Inject constructor(db: AppDatabase) {
|
|||
it.defaultPostLanguage = account.source?.language.orEmpty()
|
||||
it.defaultMediaSensitivity = account.source?.sensitive ?: false
|
||||
it.emojis = account.emojis.orEmpty()
|
||||
it.locked = account.locked
|
||||
|
||||
Log.d(TAG, "updateActiveAccount: saving account with id " + it.id)
|
||||
accountDao.insertOrReplace(it)
|
||||
|
|
|
|||
|
|
@ -42,11 +42,12 @@ import java.io.File;
|
|||
TimelineAccountEntity.class,
|
||||
ConversationEntity.class
|
||||
},
|
||||
version = 51,
|
||||
version = 52,
|
||||
autoMigrations = {
|
||||
@AutoMigration(from = 48, to = 49),
|
||||
@AutoMigration(from = 49, to = 50, spec = AppDatabase.MIGRATION_49_50.class),
|
||||
@AutoMigration(from = 50, to = 51)
|
||||
@AutoMigration(from = 50, to = 51),
|
||||
@AutoMigration(from = 51, to = 52)
|
||||
}
|
||||
)
|
||||
public abstract class AppDatabase extends RoomDatabase {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue