Skip to content

Commit 030bc23

Browse files
committed
Merge branch 'release_1.16'
* release_1.16: Finish releasing v1.16.1 Releasing v1.16.1 Makes `DialogCollator` handle redundant `scheduleUpdate` calls. Prepare release v1.16.1
2 parents 10814b1 + 3f94b3a commit 030bc23

File tree

1 file changed

+5
-2
lines changed
  • workflow-ui/core-android/src/main/java/com/squareup/workflow1/ui/navigation

1 file changed

+5
-2
lines changed

workflow-ui/core-android/src/main/java/com/squareup/workflow1/ui/navigation/DialogCollator.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,13 @@ internal class DialogCollator {
186186
onSessionsUpdated: (List<DialogSession>) -> Unit
187187
) {
188188
check(expectedUpdates > 0) {
189-
"Each update() call must be preceded by a call to ViewEnvironment.establishDialogCollator, " +
190-
"but expectedUpdates is $expectedUpdates"
189+
"Each scheduleUpdates() call must be preceded by a call to" +
190+
" ViewEnvironment.establishDialogCollator, but expectedUpdates is $expectedUpdates"
191191
}
192192

193+
// Under nested ComposeView instances we may get redundant updates from the
194+
// same caller. Just throw away the upstream ones.
195+
this.allUpdates.removeAll { it.id == id }
193196
this.allUpdates.add(IdAndUpdates(id, updates, onSessionsUpdated))
194197
if (--expectedUpdates == 0) doUpdate()
195198
}

0 commit comments

Comments
 (0)