Command Menu improvements (#857)

* Add dialogs for reset and clear actions + clear stores

* Catch failures

* Improve tests, don't reset store on failure

* Remove unnecessary i18n string

---------

Co-authored-by: philon- <philon-@users.noreply.github.com>
This commit is contained in:
Jeremy Gallant
2025-09-18 08:13:19 -04:00
committed by GitHub
co-authored by philon-
parent 1bdd923365
commit 8cc451546d
14 changed files with 567 additions and 18 deletions
@@ -57,6 +57,10 @@ export interface Device {
deleteMessages: boolean;
managedMode: boolean;
clientNotification: boolean;
resetNodeDb: boolean;
clearAllStores: boolean;
factoryResetDevice: boolean;
factoryResetConfig: boolean;
};
clientNotifications: Protobuf.Mesh.ClientNotification[];
@@ -166,6 +170,10 @@ export const useDeviceStore = createStore<PrivateDeviceState>((set, get) => ({
deleteMessages: false,
managedMode: false,
clientNotification: false,
resetNodeDb: false,
clearAllStores: false,
factoryResetDevice: false,
factoryResetConfig: false,
},
pendingSettingsChanges: false,
messageDraft: "",
+3
View File
@@ -30,6 +30,9 @@ export {
useSidebar, // TODO: Bring hook into this file
} from "@core/stores/sidebarStore";
// Re-export idb-keyval functions for clearing all stores, expand this if we add more local storage types
export { clear as clearAllStores } from "idb-keyval";
// Define hooks to access the stores
export const useNodeDB = bindStoreToDevice(
useNodeDBStore,