mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Raise the account provider history cap to 20 entries
This commit is contained in:
+1
-1
@@ -47,7 +47,7 @@ private val callRingtoneDisplayNameKey = stringPreferencesKey("notificationCallR
|
||||
|
||||
// URLs never contain a newline, so it is a safe delimiter to persist an ordered list in a single String.
|
||||
private const val HOMESERVER_HISTORY_DELIMITER = "\n"
|
||||
private const val MAX_HOMESERVER_HISTORY_SIZE = 10
|
||||
private const val MAX_HOMESERVER_HISTORY_SIZE = 20
|
||||
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultAppPreferencesStore(
|
||||
|
||||
+3
-3
@@ -110,13 +110,13 @@ class DefaultAppPreferencesStoreTest {
|
||||
fun `homeserver history is capped to the most recent entries`() = runTest {
|
||||
val store = createStore()
|
||||
|
||||
repeat(15) { index ->
|
||||
repeat(25) { index ->
|
||||
store.addHomeserverToHistory("https://server$index.org")
|
||||
}
|
||||
|
||||
val history = store.getHomeserverHistoryFlow().first()
|
||||
assertThat(history).hasSize(10)
|
||||
assertThat(history.first()).isEqualTo("https://server14.org")
|
||||
assertThat(history).hasSize(20)
|
||||
assertThat(history.first()).isEqualTo("https://server24.org")
|
||||
assertThat(history.last()).isEqualTo("https://server5.org")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user