From d0d94066f77b047da59fb324db8421bdd322ca57 Mon Sep 17 00:00:00 2001 From: EYHN Date: Fri, 4 Jul 2025 12:13:44 +0800 Subject: [PATCH] feat(ios): hidden version variant (#13019) ## Summary by CodeRabbit * **New Features** * On iOS devices, the app and editor version numbers in the About section now display only the main version (e.g., "0.23.0"), hiding any additional suffixes. * **Other** * No visible changes for users on non-iOS platforms; full version strings remain displayed. --- .../core/src/mobile/dialogs/setting/about/index.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/frontend/core/src/mobile/dialogs/setting/about/index.tsx b/packages/frontend/core/src/mobile/dialogs/setting/about/index.tsx index 645a18cfb..b94d56753 100644 --- a/packages/frontend/core/src/mobile/dialogs/setting/about/index.tsx +++ b/packages/frontend/core/src/mobile/dialogs/setting/about/index.tsx @@ -9,12 +9,21 @@ export const AboutGroup = () => { return ( - {BUILD_CONFIG.appVersion} + {BUILD_CONFIG.isIOS + ? hiddenVersionVariant(BUILD_CONFIG.appVersion) + : BUILD_CONFIG.appVersion} - {BUILD_CONFIG.editorVersion} + {BUILD_CONFIG.isIOS + ? hiddenVersionVariant(BUILD_CONFIG.editorVersion) + : BUILD_CONFIG.editorVersion} ); }; + +// 0.23.0-beta.1 -> 0.23.0 +function hiddenVersionVariant(version: string) { + return version.replace(/(\d+\.\d+\.\d+)(.*)/, '$1'); +}