From 9e520eb55107e7795bd3cb0b6d50dfa3cceb1f08 Mon Sep 17 00:00:00 2001 From: philon- Date: Fri, 29 Aug 2025 20:24:07 +0200 Subject: [PATCH] Improve state handling --- .../web/public/i18n/locales/en/dialog.json | 8 +-- packages/web/public/i18n/locales/en/ui.json | 4 +- .../src/components/Dialog/ImportDialog.tsx | 11 +++- .../web/src/components/Form/DynamicForm.tsx | 16 +----- .../web/src/core/stores/appStore/index.ts | 35 ------------ packages/web/src/pages/Config/index.tsx | 55 ++++++++++++------- 6 files changed, 49 insertions(+), 80 deletions(-) diff --git a/packages/web/public/i18n/locales/en/dialog.json b/packages/web/public/i18n/locales/en/dialog.json index be3708cd..94f75509 100644 --- a/packages/web/public/i18n/locales/en/dialog.json +++ b/packages/web/public/i18n/locales/en/dialog.json @@ -16,7 +16,7 @@ } }, "import": { - "description": "Import a Channel Set from a Meshtastic URL.", + "description": "Import a Channel Set from a Meshtastic URL.
Valid Meshtasic URLs start with \"https://meshtastic.org/e/...\"", "error": { "invalidUrl": "Invalid Meshtastic URL" }, @@ -26,9 +26,9 @@ "channelName": "Name", "channelSlot": "Slot", "channelSetUrl": "Channel Set/QR Code URL", - "usePreset": "Import LoRa Preset", - "presetDescription": "The current LoRa configuration will be overridden.", - "title": "Import Channel Set" + "useLoraConfig": "Import LoRa Config", + "presetDescription": "The current LoRa Config will be replaced.", + "title": "Import Channels" }, "locationResponse": { "title": "Location: {{identifier}}", diff --git a/packages/web/public/i18n/locales/en/ui.json b/packages/web/public/i18n/locales/en/ui.json index 4700c5ad..1c29e84a 100644 --- a/packages/web/public/i18n/locales/en/ui.json +++ b/packages/web/public/i18n/locales/en/ui.json @@ -69,8 +69,8 @@ "description": "The configuration change {{case}} has been saved." }, "saveAllSuccess": { - "title": "Save complete", - "description": "The configuration changes have been saved." + "title": "Saved", + "description": "All configuration changes have been saved." }, "favoriteNode": { "title": "{{action}} {{nodeName}} {{direction}} favorites.", diff --git a/packages/web/src/components/Dialog/ImportDialog.tsx b/packages/web/src/components/Dialog/ImportDialog.tsx index 6f19152b..fd5dba03 100644 --- a/packages/web/src/components/Dialog/ImportDialog.tsx +++ b/packages/web/src/components/Dialog/ImportDialog.tsx @@ -24,7 +24,7 @@ import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts"; import { Protobuf } from "@meshtastic/core"; import { toByteArray } from "base64-js"; import { useEffect, useState } from "react"; -import { useTranslation } from "react-i18next"; +import { Trans, useTranslation } from "react-i18next"; export interface ImportDialogProps { open: boolean; @@ -150,7 +150,12 @@ export const ImportDialog = ({ open, onOpenChange }: ImportDialogProps) => { {t("import.title")} - {t("import.description")} + + , br:
}} + /> +
@@ -177,7 +182,7 @@ export const ImportDialog = ({ open, onOpenChange }: ImportDialogProps) => { onCheckedChange={(next) => setUpdateConfig(next)} />