From a0f84fd6e364daa4db50eac2291861ffa9da80c0 Mon Sep 17 00:00:00 2001 From: mango <1711456624@qq.com> Date: Wed, 5 Aug 2026 11:29:59 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(about):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=9B=B4=E6=96=B0=E6=97=A5=E5=BF=97=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=20(#834)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.tsx | 14 +++++++++++--- frontend/src/utils/aboutUpdateActions.test.ts | 10 ++++++++++ frontend/src/utils/aboutUpdateActions.ts | 5 +++++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 frontend/src/utils/aboutUpdateActions.test.ts create mode 100644 frontend/src/utils/aboutUpdateActions.ts diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 4bcf5b75..75e75b60 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -22,6 +22,10 @@ import { isReleaseNotesRead, markReleaseNotesRead, } from './utils/updateReleaseNotesReadState'; +import { + shouldShowFooterReleaseNotesAction, + type AboutUpdateActionsSurface, +} from './utils/aboutUpdateActions'; import { type DataSyncEntryMode } from './components/dataSyncEntryMode'; import DriverManagerModal from './components/DriverManagerModal'; import LinuxCJKFontBanner from './components/LinuxCJKFontBanner'; @@ -5408,14 +5412,17 @@ function App() { ) : null ); - const renderAboutUpdateActions = (closeAction?: React.ReactNode) => [ + const renderAboutUpdateActions = ( + surface: AboutUpdateActionsSurface, + closeAction?: React.ReactNode, + ) => [ isBackgroundProgressForLatestUpdate && !isLatestUpdateDownloaded ? ( ) : null, lastUpdateInfo?.hasUpdate && !isLatestUpdateDownloaded && !isBackgroundProgressForLatestUpdate ? ( ) : null, - renderReleaseNotesActionButton(), + shouldShowFooterReleaseNotesAction(surface) ? renderReleaseNotesActionButton() : null, , )} > diff --git a/frontend/src/utils/aboutUpdateActions.test.ts b/frontend/src/utils/aboutUpdateActions.test.ts new file mode 100644 index 00000000..ee1c316f --- /dev/null +++ b/frontend/src/utils/aboutUpdateActions.test.ts @@ -0,0 +1,10 @@ +import { describe, expect, it } from 'vitest'; + +import { shouldShowFooterReleaseNotesAction } from './aboutUpdateActions'; + +describe('aboutUpdateActions', () => { + it('keeps release notes in the legacy modal footer only', () => { + expect(shouldShowFooterReleaseNotesAction('legacy-modal')).toBe(true); + expect(shouldShowFooterReleaseNotesAction('settings-center')).toBe(false); + }); +}); diff --git a/frontend/src/utils/aboutUpdateActions.ts b/frontend/src/utils/aboutUpdateActions.ts new file mode 100644 index 00000000..4509e2a9 --- /dev/null +++ b/frontend/src/utils/aboutUpdateActions.ts @@ -0,0 +1,5 @@ +export type AboutUpdateActionsSurface = 'settings-center' | 'legacy-modal'; + +export const shouldShowFooterReleaseNotesAction = ( + surface: AboutUpdateActionsSurface, +): boolean => surface === 'legacy-modal';