mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
explorer/sagas: don't show error on user cancel
fileSave can raise DomException+AbortError if use clicks cancel in the OS file dialog. We should not show an error message in this case.
This commit is contained in:
committed by
David Lechner
parent
d7726325ab
commit
1d9dd82191
@@ -139,7 +139,9 @@ function* handleExplorerArchiveAllFiles(): Generator {
|
||||
} catch (err) {
|
||||
const error = ensureError(err);
|
||||
|
||||
if (error instanceof ExplorerError && error.name === 'NoFiles') {
|
||||
if (error instanceof DOMException && error.name === 'AbortError') {
|
||||
// user canceled, don't show error message
|
||||
} else if (error instanceof ExplorerError && error.name === 'NoFiles') {
|
||||
yield* put(alertsShowAlert('explorer', 'noFilesToBackup'));
|
||||
} else {
|
||||
yield* put(
|
||||
|
||||
Reference in New Issue
Block a user