Skip to content

Commit

Permalink
initialize shouldRevisitEarlierCard in resumedeck
Browse files Browse the repository at this point in the history
  • Loading branch information
subhajitxyz committed Dec 27, 2024
1 parent c45ebc2 commit fe86e2f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class StateDeck constructor(
this.previousStates.addAll(previousStates)
this.currentDialogInteractions.addAll(currentDialogInteractions)
this.stateIndex = stateIndex
if (getStateIndexOfEarlierCard(pendingTopState.name) != null) shouldRevisitEarlierCard = true
}

/** Navigates to the previous state in the deck, or fails if this isn't possible. */
Expand Down Expand Up @@ -159,7 +160,9 @@ class StateDeck constructor(
.setContinueButtonAnimationTimestampMs(timestamp)
.setShowContinueButtonAnimation(!isContinueButtonAnimationSeen && isCurrentStateInitial())
.build()
if (!shouldRevisitEarlierCard) { currentDialogInteractions.clear() }
if (!shouldRevisitEarlierCard || getStateIndexOfEarlierCard(state.name) == null) {
currentDialogInteractions.clear()
}
pendingTopState = state
}

Expand Down

0 comments on commit fe86e2f

Please sign in to comment.