alerts/sagas: avoid reentrancy for dismiss

This fixes react complaining about calling setState from an invalid
context.
This commit is contained in:
David Lechner
2022-07-22 15:29:11 -05:00
parent e6782cb291
commit 934330272f
+3 -1
View File
@@ -35,7 +35,9 @@ function* handleShowAlert(action: ReturnType<typeof alertsShowAlert>): Generator
try {
const alertAction = yield* take(chan);
// the dismiss actions will have called this already, but other actions don't
toaster.dismiss(key);
if (alertAction !== 'dismiss') {
toaster.dismiss(key);
}
yield* put(alertsDidShowAlert(action.domain, action.specific, alertAction));
} finally {