fix(mobile): keep visit cancellation distinct from community change

Signed-off-by: Logan Johnson <loganj@squareup.com>
This commit is contained in:
Logan Johnson
2026-09-09 13:04:14 -04:00
parent b1e30bdb0b
commit 4caa1eb8d9

View File

@@ -489,11 +489,11 @@ class ComposeBar extends HookConsumerWidget {
identical(config, ref.read(relayConfigProvider));
void ensureAuthorizationCurrent() {
if (!context.mounted) throw const _ComposeAuthorizationCancelled();
if (visit != authorizationVisit.value ||
!identical(config, ref.read(relayConfigProvider))) {
if (!identical(config, ref.read(relayConfigProvider))) {
throw StateError('Community changed during authorization');
}
if (authorizationRevision != draftRevision.value) {
if (visit != authorizationVisit.value ||
authorizationRevision != draftRevision.value) {
throw const _ComposeAuthorizationCancelled();
}
}