diff --git a/src/renderer/src/hooks/useAppInit.ts b/src/renderer/src/hooks/useAppInit.ts index da9f73d0..844060e5 100644 --- a/src/renderer/src/hooks/useAppInit.ts +++ b/src/renderer/src/hooks/useAppInit.ts @@ -18,7 +18,7 @@ import useUpdateHandler from './useUpdateHandler' export function useAppInit() { const dispatch = useAppDispatch() - const { proxyUrl, language, windowStyle, manualUpdateCheck, proxyMode, customCss } = useSettings() + const { proxyUrl, language, windowStyle, autoCheckUpdate, proxyMode, customCss } = useSettings() const { minappShow } = useRuntime() const { setDefaultModel, setTopicNamingModel, setTranslateModel } = useDefaultModel() const avatar = useLiveQuery(() => db.settings.get('image://avatar')) @@ -36,13 +36,13 @@ export function useAppInit() { document.getElementById('spinner')?.remove() runAsyncFunction(async () => { const { isPackaged } = await window.api.getAppInfo() - if (isPackaged && !manualUpdateCheck) { + if (isPackaged && autoCheckUpdate) { await delay(2) const { updateInfo } = await window.api.checkForUpdate() dispatch(setUpdateState({ info: updateInfo })) } }) - }, [dispatch, manualUpdateCheck]) + }, [dispatch, autoCheckUpdate]) useEffect(() => { if (proxyMode === 'system') { diff --git a/src/renderer/src/i18n/locales/en-us.json b/src/renderer/src/i18n/locales/en-us.json index ab4603e8..b996edc7 100644 --- a/src/renderer/src/i18n/locales/en-us.json +++ b/src/renderer/src/i18n/locales/en-us.json @@ -921,7 +921,7 @@ "general.display.title": "Display Settings", "general.emoji_picker": "Emoji Picker", "general.image_upload": "Image Upload", - "general.manually_check_update.title": "Turn off update checking", + "general.auto_check_update.title": "Auto update checking", "general.reset.button": "Reset", "general.reset.title": "Data Reset", "general.restore.button": "Restore", @@ -1234,4 +1234,4 @@ "visualization": "Visualization" } } -} \ No newline at end of file +} diff --git a/src/renderer/src/i18n/locales/zh-cn.json b/src/renderer/src/i18n/locales/zh-cn.json index 4fe2e14e..01b6d49d 100644 --- a/src/renderer/src/i18n/locales/zh-cn.json +++ b/src/renderer/src/i18n/locales/zh-cn.json @@ -921,7 +921,7 @@ "general.display.title": "显示设置", "general.emoji_picker": "表情选择器", "general.image_upload": "图片上传", - "general.manually_check_update.title": "关闭更新检测", + "general.auto_check_update.title": "自动检测更新", "general.reset.button": "重置", "general.reset.title": "重置数据", "general.restore.button": "恢复", @@ -1234,4 +1234,4 @@ "visualization": "可视化" } } -} \ No newline at end of file +} diff --git a/src/renderer/src/pages/settings/AboutSettings.tsx b/src/renderer/src/pages/settings/AboutSettings.tsx index 563ddf29..edd4eed4 100644 --- a/src/renderer/src/pages/settings/AboutSettings.tsx +++ b/src/renderer/src/pages/settings/AboutSettings.tsx @@ -9,7 +9,7 @@ import { useRuntime } from '@renderer/hooks/useRuntime' import { useSettings } from '@renderer/hooks/useSettings' import { useAppDispatch } from '@renderer/store' import { setUpdateState } from '@renderer/store/runtime' -import { setManualUpdateCheck } from '@renderer/store/settings' +import { setAutoCheckUpdate } from '@renderer/store/settings' import { ThemeMode } from '@renderer/types' import { compareVersions, runAsyncFunction } from '@renderer/utils' import { Avatar, Button, Progress, Row, Switch, Tag } from 'antd' @@ -25,7 +25,7 @@ import { SettingContainer, SettingDivider, SettingGroup, SettingRow, SettingTitl const AboutSettings: FC = () => { const [version, setVersion] = useState('') const { t } = useTranslation() - const { manualUpdateCheck } = useSettings() + const { autoCheckUpdate } = useSettings() const { theme } = useTheme() const dispatch = useAppDispatch() const { update } = useRuntime() @@ -146,8 +146,8 @@ const AboutSettings: FC = () => { - {t('settings.general.manually_check_update.title')} - dispatch(setManualUpdateCheck(v))} /> + {t('settings.general.auto_check_update.title')} + dispatch(setAutoCheckUpdate(v))} /> {hasNewVersion && update.info && ( @@ -161,7 +161,7 @@ const AboutSettings: FC = () => { {typeof update.info.releaseNotes === 'string' - ? update.info.releaseNotes.replaceAll('\n', '\n\n') + ? update.info.releaseNotes.replace(/\n/g, '\n\n') : update.info.releaseNotes?.map((note) => note.note).join('\n')} diff --git a/src/renderer/src/store/settings.ts b/src/renderer/src/store/settings.ts index b38557d5..844a1f27 100644 --- a/src/renderer/src/store/settings.ts +++ b/src/renderer/src/store/settings.ts @@ -45,7 +45,7 @@ export interface SettingsState { pasteLongTextAsFile: boolean pasteLongTextThreshold: number clickAssistantToShowTopic: boolean - manualUpdateCheck: boolean + autoCheckUpdate: boolean renderInputMessageAsMarkdown: boolean codeShowLineNumbers: boolean codeCollapsible: boolean @@ -130,7 +130,7 @@ const initialState: SettingsState = { pasteLongTextAsFile: false, pasteLongTextThreshold: 1500, clickAssistantToShowTopic: false, - manualUpdateCheck: false, + autoCheckUpdate: true, renderInputMessageAsMarkdown: false, codeShowLineNumbers: false, codeCollapsible: false, @@ -261,15 +261,15 @@ const settingsSlice = createSlice({ setPasteLongTextAsFile: (state, action: PayloadAction) => { state.pasteLongTextAsFile = action.payload }, + setAutoCheckUpdate: (state, action: PayloadAction) => { + state.autoCheckUpdate = action.payload + }, setRenderInputMessageAsMarkdown: (state, action: PayloadAction) => { state.renderInputMessageAsMarkdown = action.payload }, setClickAssistantToShowTopic: (state, action: PayloadAction) => { state.clickAssistantToShowTopic = action.payload }, - setManualUpdateCheck: (state, action: PayloadAction) => { - state.manualUpdateCheck = action.payload - }, setWebdavHost: (state, action: PayloadAction) => { state.webdavHost = action.payload }, @@ -444,9 +444,9 @@ export const { setShowTopicTime, setShowAssistantIcon, setPasteLongTextAsFile, + setAutoCheckUpdate, setRenderInputMessageAsMarkdown, setClickAssistantToShowTopic, - setManualUpdateCheck, setWebdavHost, setWebdavUser, setWebdavPass,