Merge pull request #5678 from element-hq/feature/bma/countAccounts
Introduce new query to count accounts
This commit is contained in:
commit
d6360e82e0
9 changed files with 33 additions and 4 deletions
|
|
@ -90,7 +90,7 @@ class OnBoardingPresenter(
|
|||
}
|
||||
val isAddingAccount by produceState(initialValue = false) {
|
||||
// We are adding an account if there is at least one session already stored
|
||||
value = sessionStore.getAllSessions().isNotEmpty()
|
||||
value = sessionStore.numberOfSessions() > 0
|
||||
}
|
||||
|
||||
val loginMode by loginHelper.collectLoginMode()
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ class DefaultBugReporter(
|
|||
}
|
||||
}
|
||||
val sessionData = sessionStore.getLatestSession()
|
||||
val numberOfAccounts = sessionStore.getAllSessions().size
|
||||
val numberOfAccounts = sessionStore.numberOfSessions()
|
||||
val deviceId = sessionData?.deviceId ?: "undefined"
|
||||
val userId = sessionData?.userId?.let { UserId(it) }
|
||||
// build the multi part request
|
||||
|
|
|
|||
|
|
@ -58,9 +58,11 @@ class SignedOutPresenterTest {
|
|||
val initialState = awaitItem()
|
||||
assertThat(initialState.signedOutSession).isEqualTo(aSessionData)
|
||||
assertThat(sessionStore.getAllSessions()).isNotEmpty()
|
||||
assertThat(sessionStore.numberOfSessions()).isEqualTo(1)
|
||||
initialState.eventSink(SignedOutEvents.SignInAgain)
|
||||
assertThat(awaitItem().signedOutSession).isNull()
|
||||
assertThat(sessionStore.getAllSessions()).isEmpty()
|
||||
assertThat(sessionStore.numberOfSessions()).isEqualTo(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue