Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,7 @@ open class DeckPicker :
}

is StartupResponse.Success -> {
viewModel.flowOfStartupResponse.value = null // Prevent duplicate startup on re-resume
showStartupScreensAndDialogs(sharedPrefs(), 0)

if (tryShowStudyOptionsPanel()) {
Expand Down
11 changes: 11 additions & 0 deletions AnkiDroid/src/test/java/com/ichi2/anki/DeckPickerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,17 @@ class DeckPickerTest : RobolectricTest() {
)
}

@Test
fun `startup response is cleared after handling so it does not re-run on resume`() =
deckPicker {
ShadowLooper.runUiThreadTasksIncludingDelayedTasks()
assertThat(
"startup response cleared after handling so it does not re-run on resume",
viewModel.flowOfStartupResponse.value,
nullValue(),
)
}

/**
* Emulates a null collection and a `BackendDbLockedException`
*
Expand Down
Loading