From d935de3e57ec0836af4f7153c56b0e60baf99d22 Mon Sep 17 00:00:00 2001 From: ilarioscandurra Date: Fri, 7 Apr 2023 20:50:06 +0200 Subject: [PATCH 1/3] Update: Confirmation on reset chats and settings --- app/components/settings.tsx | 18 ++++++++++++++++-- app/locales/cn.ts | 6 ++++++ app/locales/en.ts | 6 ++++++ app/locales/es.ts | 6 ++++++ app/locales/it.ts | 6 ++++++ app/locales/tw.ts | 6 ++++++ 6 files changed, 46 insertions(+), 2 deletions(-) diff --git a/app/components/settings.tsx b/app/components/settings.tsx index d1d217ea..0d1c1d05 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -156,7 +156,14 @@ export function Settings(props: { closeSettings: () => void }) {
} - onClick={clearSessions} + onClick={() => { + const confirmed = window.confirm( + `${Locale.Settings.Actions.ConfirmClearAll.Confirm}`, + ); + if (confirmed) { + clearSessions(); + } + }} bordered title={Locale.Settings.Actions.ClearAll} /> @@ -164,7 +171,14 @@ export function Settings(props: { closeSettings: () => void }) {
} - onClick={resetConfig} + onClick={() => { + const confirmed = window.confirm( + `${Locale.Settings.Actions.ConfirmResetAll.Confirm}`, + ); + if (confirmed) { + resetConfig(); + } + }} bordered title={Locale.Settings.Actions.ResetAll} /> diff --git a/app/locales/cn.ts b/app/locales/cn.ts index e21272a1..de3c05c8 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -57,6 +57,12 @@ const cn = { ClearAll: "清除所有数据", ResetAll: "重置所有选项", Close: "关闭", + ConfirmResetAll: { + Confirm: "Are you sure you want to reset all configurations?", + }, + ConfirmClearAll: { + Confirm: "Are you sure you want to reset all chat?", + }, }, Lang: { Name: "Language", diff --git a/app/locales/en.ts b/app/locales/en.ts index 61d20b60..483e21d1 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -60,6 +60,12 @@ const en: LocaleType = { ClearAll: "Clear All Data", ResetAll: "Reset All Settings", Close: "Close", + ConfirmResetAll: { + Confirm: "Are you sure you want to reset all configurations?", + }, + ConfirmClearAll: { + Confirm: "Are you sure you want to reset all chat?", + }, }, Lang: { Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language` diff --git a/app/locales/es.ts b/app/locales/es.ts index 5a83cb55..06277f6b 100644 --- a/app/locales/es.ts +++ b/app/locales/es.ts @@ -60,6 +60,12 @@ const es: LocaleType = { ClearAll: "Borrar todos los datos", ResetAll: "Restablecer todas las configuraciones", Close: "Cerrar", + ConfirmResetAll: { + Confirm: "Are you sure you want to reset all configurations?", + }, + ConfirmClearAll: { + Confirm: "Are you sure you want to reset all chat?", + }, }, Lang: { Name: "Language", diff --git a/app/locales/it.ts b/app/locales/it.ts index 7108090e..70967d96 100644 --- a/app/locales/it.ts +++ b/app/locales/it.ts @@ -60,6 +60,12 @@ const it: LocaleType = { ClearAll: "Cancella tutti i dati", ResetAll: "Resetta tutte le impostazioni", Close: "Chiudi", + ConfirmResetAll: { + Confirm: "Sei sicuro vuoi cancellare tutte le impostazioni?", + }, + ConfirmClearAll: { + Confirm: "Sei sicuro vuoi cancellare tutte le chat?", + }, }, Lang: { Name: "Lingue", diff --git a/app/locales/tw.ts b/app/locales/tw.ts index ff1794b5..3861a671 100644 --- a/app/locales/tw.ts +++ b/app/locales/tw.ts @@ -58,6 +58,12 @@ const tw: LocaleType = { ClearAll: "清除所有數據", ResetAll: "重置所有設定", Close: "關閉", + ConfirmResetAll: { + Confirm: "Are you sure you want to reset all configurations?", + }, + ConfirmClearAll: { + Confirm: "Are you sure you want to reset all chat?", + }, }, Lang: { Name: "Language", From 5b9fd1b1012a1a13d9b8033c91697e519f65cf33 Mon Sep 17 00:00:00 2001 From: Ilario Scandurra Date: Fri, 7 Apr 2023 22:19:06 +0200 Subject: [PATCH 2/3] Update sync.yml --- .github/workflows/sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 38c272e8..7cb63997 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -5,7 +5,7 @@ permissions: on: schedule: - - cron: "0 */6 * * *" # every 6 hours + - cron: "0 * * * *" # every 6 hours workflow_dispatch: jobs: From 00ba47c4dec90d0ff6094dcc0d785a9b55d52700 Mon Sep 17 00:00:00 2001 From: Ilario Scandurra Date: Fri, 7 Apr 2023 22:19:21 +0200 Subject: [PATCH 3/3] Update sync.yml --- .github/workflows/sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 7cb63997..52feae50 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -5,7 +5,7 @@ permissions: on: schedule: - - cron: "0 * * * *" # every 6 hours + - cron: "0 * * * *" # every hour workflow_dispatch: jobs: