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:
co-authored by
philon-
parent
1bdd923365
commit
8cc451546d
@@ -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: "",
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user