mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +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.
|
// 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 HOMESERVER_HISTORY_DELIMITER = "\n"
|
||||||
private const val MAX_HOMESERVER_HISTORY_SIZE = 10
|
private const val MAX_HOMESERVER_HISTORY_SIZE = 20
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
class DefaultAppPreferencesStore(
|
class DefaultAppPreferencesStore(
|
||||||
|
|||||||
+3
-3
@@ -110,13 +110,13 @@ class DefaultAppPreferencesStoreTest {
|
|||||||
fun `homeserver history is capped to the most recent entries`() = runTest {
|
fun `homeserver history is capped to the most recent entries`() = runTest {
|
||||||
val store = createStore()
|
val store = createStore()
|
||||||
|
|
||||||
repeat(15) { index ->
|
repeat(25) { index ->
|
||||||
store.addHomeserverToHistory("https://server$index.org")
|
store.addHomeserverToHistory("https://server$index.org")
|
||||||
}
|
}
|
||||||
|
|
||||||
val history = store.getHomeserverHistoryFlow().first()
|
val history = store.getHomeserverHistoryFlow().first()
|
||||||
assertThat(history).hasSize(10)
|
assertThat(history).hasSize(20)
|
||||||
assertThat(history.first()).isEqualTo("https://server14.org")
|
assertThat(history.first()).isEqualTo("https://server24.org")
|
||||||
assertThat(history.last()).isEqualTo("https://server5.org")
|
assertThat(history.last()).isEqualTo("https://server5.org")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user