Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix(settings): hide the core segment in the OTA version label (#20538)

Innei3c570c85be3b
diff --git a/src/features/Settings/about/features/otaVersion.test.ts b/src/features/Settings/about/features/otaVersion.test.ts
index 3c05ef2e4e2..3c86ed5cd77 100644
--- a/src/features/Settings/about/features/otaVersion.test.ts
+++ b/src/features/Settings/about/features/otaVersion.test.ts
@@ -36,4 +36,8 @@ describe('formatOtaVersionLabel', () => {
it('does not add a v prefix to non-semver OTA names', () => {
expect(formatOtaVersionLabel('r1')).toBe('OTA r1');
});
+
+ it('hides the core segment in the displayed version', () => {
+ expect(formatOtaVersionLabel('2.2.19-canary.33-core.2')).toBe('OTA 2.2.19-canary.33-2');
+ });
});
diff --git a/src/features/Settings/about/features/otaVersion.ts b/src/features/Settings/about/features/otaVersion.ts
index e71493fb604..710a79a97e4 100644
--- a/src/features/Settings/about/features/otaVersion.ts
+++ b/src/features/Settings/about/features/otaVersion.ts
@@ -3,4 +3,5 @@ import type { CoreUpdateStatus } from '@lobechat/electron-client-ipc';
export const getDisplayedOtaVersion = (status: CoreUpdateStatus | null): string | null =>
status?.running ?? status?.current ?? null;
-export const formatOtaVersionLabel = (version: string): string => `OTA ${version}`;
+export const formatOtaVersionLabel = (version: string): string =>
+ `OTA ${version.replace('-core.', '-')}`;