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:
David Lechner
2022-04-08 10:52:54 -05:00
parent 8ac77560fb
commit fad7b0114a
12 changed files with 261 additions and 121 deletions
+1
View File
@@ -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'),
+5
View File
@@ -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);
}