From 5b71c7314af5bcd9d076097be1c9e66ed09bdadd Mon Sep 17 00:00:00 2001 From: David Lechner Date: Wed, 10 Aug 2022 16:45:40 -0500 Subject: [PATCH] app/App: move firmware flash dialogs from settings The flash firmware dialog show action can be triggered even when the settings panel is not mounted, so we need to move the dialogs up in the tree to the app level. Fixes: https://github.com/pybricks/support/issues/694 --- CHANGELOG.md | 2 ++ src/app/App.tsx | 4 ++++ src/settings/Settings.tsx | 4 ---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3574d5f0..c67a3e36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,10 @@ ### Fixed - Fixed run button enabled when no file open ([support#691]). +- Fixed flash firmware dialog not showing when settings not open ([support#694]). [support#691]: https://github.com/pybricks/support/issues/691 +[support#694]: https://github.com/pybricks/support/issues/694 ## [2.0.0-beta.5] - 2022-07-28 diff --git a/src/app/App.tsx b/src/app/App.tsx index af08dad1..434af466 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -10,6 +10,8 @@ import SplitterLayout from 'react-splitter-layout'; import { useLocalStorage, useTernaryDarkMode } from 'usehooks-ts'; import Activities from '../activities/Activities'; import Editor from '../editor/Editor'; +import { InstallPybricksDialog } from '../firmware/installPybricksDialog/InstallPybricksDialog'; +import RestoreOfficialDialog from '../firmware/restoreOfficialDialog/RestoreOfficialDialog'; import { useSettingIsShowDocsEnabled } from '../settings/hooks'; import StatusBar from '../status-bar/StatusBar'; import Terminal from '../terminal/Terminal'; @@ -198,6 +200,8 @@ const App: React.VFC = () => { + + ); }; diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index b31f823e..9c805a48 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -22,8 +22,6 @@ import { import { Button } from '../components/Button'; import HelpButton from '../components/HelpButton'; import { firmwareInstallPybricks } from '../firmware/actions'; -import { InstallPybricksDialog } from '../firmware/installPybricksDialog/InstallPybricksDialog'; -import RestoreOfficialDialog from '../firmware/restoreOfficialDialog/RestoreOfficialDialog'; import { firmwareRestoreOfficialDialogShow } from '../firmware/restoreOfficialDialog/actions'; import { pseudolocalize } from '../i18n'; import { useSelector } from '../reducers'; @@ -104,7 +102,6 @@ const Settings: React.VoidFunctionComponent = () => { label={i18n.translate('firmware.flashPybricksButton.label')} onPress={() => dispatch(firmwareInstallPybricks())} /> -