diff --git a/app/src/main/kotlin/com/bitwarden/authenticator/data/authenticator/repository/AuthenticatorRepository.kt b/app/src/main/kotlin/com/bitwarden/authenticator/data/authenticator/repository/AuthenticatorRepository.kt index ba2600ff53..39ca5e7370 100644 --- a/app/src/main/kotlin/com/bitwarden/authenticator/data/authenticator/repository/AuthenticatorRepository.kt +++ b/app/src/main/kotlin/com/bitwarden/authenticator/data/authenticator/repository/AuthenticatorRepository.kt @@ -48,12 +48,6 @@ interface AuthenticatorRepository { */ fun getItemStateFlow(itemId: String): StateFlow> - /** - * Flow that represents the data for a single verification code item. - * This may emit null if any issues arise during code generation. - */ - fun getAuthCodeFlow(cipherId: String): StateFlow> - /** * Flow that represents the data for the TOTP verification codes for ciphers items. * This may emit an empty list if any issues arise during code generation. diff --git a/app/src/main/kotlin/com/bitwarden/authenticator/data/authenticator/repository/AuthenticatorRepositoryImpl.kt b/app/src/main/kotlin/com/bitwarden/authenticator/data/authenticator/repository/AuthenticatorRepositoryImpl.kt index 7eb500ce22..3215daf3e3 100644 --- a/app/src/main/kotlin/com/bitwarden/authenticator/data/authenticator/repository/AuthenticatorRepositoryImpl.kt +++ b/app/src/main/kotlin/com/bitwarden/authenticator/data/authenticator/repository/AuthenticatorRepositoryImpl.kt @@ -33,7 +33,6 @@ import kotlinx.coroutines.flow.asSharedFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.firstOrNull import kotlinx.coroutines.flow.flatMapLatest -import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onEach @@ -134,32 +133,6 @@ class AuthenticatorRepositoryImpl @Inject constructor( initialValue = DataState.Loading, ) - @OptIn(ExperimentalCoroutinesApi::class) - override fun getAuthCodeFlow(cipherId: String): StateFlow> { - return getItemStateFlow(cipherId) - .flatMapLatest { cipherDataState -> - val cipher = cipherDataState.data - ?: return@flatMapLatest flowOf(DataState.Loaded(null)) - - totpCodeManager.getTotpCodeStateFlow(item = cipher) - .map { totpCodeDataState -> - combineDataStates( - totpCodeDataState, - cipherDataState, - ) { totpCodeData, _ -> - // Just return the verification items; we are only combining the - // DataStates to know the overall state. - totpCodeData - } - } - } - .stateIn( - scope = unconfinedScope, - started = SharingStarted.WhileSubscribed(STOP_TIMEOUT_DELAY_MS), - initialValue = DataState.Loading, - ) - } - @OptIn(ExperimentalCoroutinesApi::class) override fun getAuthCodesFlow(): StateFlow>> { return authenticatorDataFlow