From 6505a93645abb36667afe6a6ce6bbed9c3423bab Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Sun, 13 Oct 2024 21:56:17 +0900 Subject: [PATCH] fix(api-server): fix i18n --- src/plugins/api-server/menu.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/api-server/menu.ts b/src/plugins/api-server/menu.ts index 46f571b3..4273877f 100644 --- a/src/plugins/api-server/menu.ts +++ b/src/plugins/api-server/menu.ts @@ -32,13 +32,13 @@ export const onMenu = async ({ ...promptOptions(), }, window, - ) ?? defaultAPIServerConfig.hostname; + ) ?? (config.hostname ?? defaultAPIServerConfig.hostname); setConfig({ ...config, hostname: newHostname }); }, }, { - label: t('plugins.api-server.menu.port'), + label: t('plugins.api-server.menu.port.label'), type: 'normal', async click() { const config = await getConfig(); @@ -54,17 +54,17 @@ export const onMenu = async ({ ...promptOptions(), }, window, - ) ?? defaultAPIServerConfig.port; + ) ?? (config.port ?? defaultAPIServerConfig.port); setConfig({ ...config, port: newPort }); }, }, { - label: t('plugins.api-server.menu.auth-strategy'), + label: t('plugins.api-server.menu.auth-strategy.label'), type: 'submenu', submenu: [ { - label: t('plugins.api-server.menu.auth-strategy.submenu.auth-at-first'), + label: t('plugins.api-server.menu.auth-strategy.submenu.auth-at-first.label'), type: 'radio', checked: config.authStrategy === 'AUTH_AT_FIRST', click() { @@ -72,7 +72,7 @@ export const onMenu = async ({ }, }, { - label: t('plugins.api-server.menu.auth-strategy.submenu.none'), + label: t('plugins.api-server.menu.auth-strategy.submenu.none.label'), type: 'radio', checked: config.authStrategy === 'NONE', click() {