mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-15 11:04:49 +00:00
explorer/newFileWizard: refactor
This refactors the new file wizard to be more independent. Most of the control is now done through the saga instead of splitting it between react and the sagas. Also fix a few issues while we are touching this: - pressing enter now accepts the dialog - newly created file is now activated in the editor
This commit is contained in:
@@ -139,6 +139,7 @@ test.each([
|
||||
bleDIServiceDidReceiveFirmwareRevision(firmwareVersion),
|
||||
explorerDidFailToArchiveAllFiles(new DOMException('test message', 'AbortError')),
|
||||
explorerDidFailToImportFiles(new DOMException('test message', 'AbortError')),
|
||||
explorerDidFailToCreateNewFile(new DOMException('test message', 'AbortError')),
|
||||
explorerDidFailToExportFile(
|
||||
'test.file',
|
||||
new DOMException('test message', 'AbortError'),
|
||||
|
||||
@@ -448,6 +448,11 @@ function* showExplorerFailToImportFiles(
|
||||
function* showExplorerFailToCreateFile(
|
||||
action: ReturnType<typeof explorerDidFailToCreateNewFile>,
|
||||
): Generator {
|
||||
if (action.error.name === 'AbortError') {
|
||||
// user clicked cancel button - not an error
|
||||
return;
|
||||
}
|
||||
|
||||
yield* showUnexpectedError(I18nId.ExplorerFailedToCreate, action.error);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user