From ac128e32f96190a25ac6aafa316042dfdd4eef2e Mon Sep 17 00:00:00 2001 From: PhilReact Date: Mon, 28 Jul 2025 16:21:57 +0300 Subject: [PATCH 1/2] ability to remove apikey from storage --- src/components/NotAuthenticated.tsx | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/components/NotAuthenticated.tsx b/src/components/NotAuthenticated.tsx index 2415e73..5fb9b65 100644 --- a/src/components/NotAuthenticated.tsx +++ b/src/components/NotAuthenticated.tsx @@ -1102,6 +1102,53 @@ export const NotAuthenticated = ({ onChange={handleFileChangeApiKey} // File input handler /> + {(apiKey || importedApiKey) && ( + + )} From 6c0b43068522a5f54f53b456734d288d720eeb04 Mon Sep 17 00:00:00 2001 From: PhilReact Date: Mon, 28 Jul 2025 16:38:09 +0300 Subject: [PATCH 2/2] fixes --- src/components/NotAuthenticated.tsx | 6 +++++- src/i18n/locales/ar/auth.json | 3 ++- src/i18n/locales/de/auth.json | 3 ++- src/i18n/locales/en/auth.json | 3 ++- src/i18n/locales/en/tutorial.json | 30 ++++++++++++++--------------- src/i18n/locales/es/auth.json | 3 ++- src/i18n/locales/fr/auth.json | 3 ++- src/i18n/locales/it/auth.json | 3 ++- src/i18n/locales/ja/auth.json | 3 ++- src/i18n/locales/pt/auth.json | 3 ++- src/i18n/locales/ru/auth.json | 3 ++- src/i18n/locales/zh/auth.json | 3 ++- 12 files changed, 40 insertions(+), 26 deletions(-) diff --git a/src/components/NotAuthenticated.tsx b/src/components/NotAuthenticated.tsx index 5fb9b65..fe51fdc 100644 --- a/src/components/NotAuthenticated.tsx +++ b/src/components/NotAuthenticated.tsx @@ -202,6 +202,8 @@ export const NotAuthenticated = ({ hasLocalNodeRef.current = hasLocalNode; }, [hasLocalNode]); + console.log('apiKey', apiKey); + const validateApiKey = useCallback(async (key, fromStartUp) => { try { if (key === 'isGateway') return; @@ -1142,9 +1144,11 @@ export const NotAuthenticated = ({ url: 'http://127.0.0.1:12391', }); setUseLocalNode(false); + setApiKey(null); + handleSetGlobalApikey(null); }} > - {t('core:action.remove', { + {t('auth:apikey.clear_storage', { postProcess: 'capitalizeFirstChar', })} diff --git a/src/i18n/locales/ar/auth.json b/src/i18n/locales/ar/auth.json index 826f34d..d8281b4 100644 --- a/src/i18n/locales/ar/auth.json +++ b/src/i18n/locales/ar/auth.json @@ -44,7 +44,8 @@ "enter": "إدخال مفتاح API", "import": "استيراد مفتاح API", "key": "مفتاح API", - "select_valid": "اختر مفتاح API صالح" + "select_valid": "اختر مفتاح API صالح", + "clear_storage": "إزالة من التخزين" }, "authentication": "المصادقة", "blocked_users": "المستخدمون المحظورون", diff --git a/src/i18n/locales/de/auth.json b/src/i18n/locales/de/auth.json index 7f67427..edac738 100644 --- a/src/i18n/locales/de/auth.json +++ b/src/i18n/locales/de/auth.json @@ -44,7 +44,8 @@ "enter": "API-Schlüssel eingeben", "import": "API-Schlüssel importieren", "key": "API-Schlüssel", - "select_valid": "Gültigen API-Schlüssel auswählen" + "select_valid": "Gültigen API-Schlüssel auswählen", + "clear_storage": "aus dem Speicher löschen" }, "authentication": "Authentifizierung", "blocked_users": "blockierte Benutzer", diff --git a/src/i18n/locales/en/auth.json b/src/i18n/locales/en/auth.json index a128a3d..4da279d 100644 --- a/src/i18n/locales/en/auth.json +++ b/src/i18n/locales/en/auth.json @@ -44,7 +44,8 @@ "enter": "enter APIkey", "import": "import APIkey", "key": "API key", - "select_valid": "select a valid apikey" + "select_valid": "select a valid apikey", + "clear_storage": "clear from storage" }, "authentication": "authentication", "blocked_users": "blocked users", diff --git a/src/i18n/locales/en/tutorial.json b/src/i18n/locales/en/tutorial.json index 69759a3..cc54061 100644 --- a/src/i18n/locales/en/tutorial.json +++ b/src/i18n/locales/en/tutorial.json @@ -1,21 +1,21 @@ { - "1_getting_started": "1. Primeiros Passos", - "2_overview": "2. Visão Geral", - "3_groups": "3. Grupos do Qortal", - "4_obtain_qort": "4. Obtendo QORT", - "account_creation": "criação de conta", - "important_info": "informações importantes", + "1_getting_started": "1. Getting Started", + "2_overview": "2. Overview", + "3_groups": "3. Qortal Groups", + "4_obtain_qort": "4. Obtaining Qort", + "account_creation": "account creation", + "important_info": "important information", "apps": { - "dashboard": "1. Painel de Aplicativos", - "navigation": "2. Navegação de Aplicativos" + "dashboard": "1. Apps Dashboard", + "navigation": "2. Apps Navigation" }, "initial": { - "recommended_qort_qty": "tenha pelo menos {{ quantity }} QORT na sua carteira", - "explore": "explorar", - "general_chat": "chat geral", - "getting_started": "primeiros passos", - "register_name": "registrar um nome", - "see_apps": "ver aplicativos", - "trade_qort": "trocar QORT" + "recommended_qort_qty": "have at least {{ quantity }} QORT in your wallet", + "explore": "explore", + "general_chat": "general chat", + "getting_started": "getting started", + "register_name": "register a name", + "see_apps": "see apps", + "trade_qort": "trade QORT" } } diff --git a/src/i18n/locales/es/auth.json b/src/i18n/locales/es/auth.json index d17e1ee..f1aa530 100644 --- a/src/i18n/locales/es/auth.json +++ b/src/i18n/locales/es/auth.json @@ -44,7 +44,8 @@ "enter": "ingresar clave API", "import": "importar clave API", "key": "clave API", - "select_valid": "selecciona una clave API válida" + "select_valid": "selecciona una clave API válida", + "clear_storage": "borrar del almacenamiento" }, "authentication": "autenticación", "blocked_users": "usuarios bloqueados", diff --git a/src/i18n/locales/fr/auth.json b/src/i18n/locales/fr/auth.json index 27a6801..1e1e639 100644 --- a/src/i18n/locales/fr/auth.json +++ b/src/i18n/locales/fr/auth.json @@ -44,7 +44,8 @@ "enter": "entrer la clé API", "import": "importer la clé API", "key": "clé API", - "select_valid": "sélectionner une clé API valide" + "select_valid": "sélectionner une clé API valide", + "clear_storage": "effacer du stockage" }, "authentication": "authentification", "blocked_users": "utilisateurs bloqués", diff --git a/src/i18n/locales/it/auth.json b/src/i18n/locales/it/auth.json index e5b1f6e..c83cbc9 100644 --- a/src/i18n/locales/it/auth.json +++ b/src/i18n/locales/it/auth.json @@ -44,7 +44,8 @@ "enter": "inserisci Apikey", "import": "importa apikey", "key": "chiave API", - "select_valid": "seleziona una apikey valida" + "select_valid": "seleziona una apikey valida", + "clear_storage": "rimuovi dalla memoria" }, "authentication": "autenticazione", "blocked_users": "utenti bloccati", diff --git a/src/i18n/locales/ja/auth.json b/src/i18n/locales/ja/auth.json index 5ab4735..54bf12b 100644 --- a/src/i18n/locales/ja/auth.json +++ b/src/i18n/locales/ja/auth.json @@ -44,7 +44,8 @@ "enter": "APIキーを入力", "import": "APIキーをインポート", "key": "APIキー", - "select_valid": "有効なAPIキーを選択してください" + "select_valid": "有効なAPIキーを選択してください", + "clear_storage": "ストレージから削除" }, "authentication": "認証", "blocked_users": "ブロックされたユーザー", diff --git a/src/i18n/locales/pt/auth.json b/src/i18n/locales/pt/auth.json index 258f5b5..d99975d 100644 --- a/src/i18n/locales/pt/auth.json +++ b/src/i18n/locales/pt/auth.json @@ -44,7 +44,8 @@ "enter": "digitar APIkey", "import": "importar APIkey", "key": "API key", - "select_valid": "selecionar uma APIkey válida" + "select_valid": "selecionar uma APIkey válida", + "clear_storage": "limpar do armazenamento" }, "authentication": "autenticação", "blocked_users": "usuarios bloqueados", diff --git a/src/i18n/locales/ru/auth.json b/src/i18n/locales/ru/auth.json index 407d31f..4ca3207 100644 --- a/src/i18n/locales/ru/auth.json +++ b/src/i18n/locales/ru/auth.json @@ -44,7 +44,8 @@ "enter": "введите API-ключ", "import": "импортировать API-ключ", "key": "API-ключ", - "select_valid": "выберите допустимый API-ключ" + "select_valid": "выберите допустимый API-ключ", + "clear_storage": "удалить из хранилища" }, "authentication": "аутентификация", "blocked_users": "заблокированные пользователи", diff --git a/src/i18n/locales/zh/auth.json b/src/i18n/locales/zh/auth.json index 1c21f88..6538520 100644 --- a/src/i18n/locales/zh/auth.json +++ b/src/i18n/locales/zh/auth.json @@ -44,7 +44,8 @@ "enter": "输入 API 密钥", "import": "导入 API 密钥", "key": "API 密钥", - "select_valid": "请选择一个有效的 API 密钥" + "select_valid": "请选择一个有效的 API 密钥", + "clear_storage": "从存储中清除" }, "authentication": "身份验证", "blocked_users": "已屏蔽用户",