mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 18:26:05 +08:00
feat(ios): hidden version variant (#13019)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -9,12 +9,21 @@ export const AboutGroup = () => {
|
|||||||
return (
|
return (
|
||||||
<SettingGroup title={t['com.affine.mobile.setting.about.title']()}>
|
<SettingGroup title={t['com.affine.mobile.setting.about.title']()}>
|
||||||
<RowLayout label={t['com.affine.mobile.setting.about.appVersion']()}>
|
<RowLayout label={t['com.affine.mobile.setting.about.appVersion']()}>
|
||||||
{BUILD_CONFIG.appVersion}
|
{BUILD_CONFIG.isIOS
|
||||||
|
? hiddenVersionVariant(BUILD_CONFIG.appVersion)
|
||||||
|
: BUILD_CONFIG.appVersion}
|
||||||
</RowLayout>
|
</RowLayout>
|
||||||
|
|
||||||
<RowLayout label={t['com.affine.mobile.setting.about.editorVersion']()}>
|
<RowLayout label={t['com.affine.mobile.setting.about.editorVersion']()}>
|
||||||
{BUILD_CONFIG.editorVersion}
|
{BUILD_CONFIG.isIOS
|
||||||
|
? hiddenVersionVariant(BUILD_CONFIG.editorVersion)
|
||||||
|
: BUILD_CONFIG.editorVersion}
|
||||||
</RowLayout>
|
</RowLayout>
|
||||||
</SettingGroup>
|
</SettingGroup>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 0.23.0-beta.1 -> 0.23.0
|
||||||
|
function hiddenVersionVariant(version: string) {
|
||||||
|
return version.replace(/(\d+\.\d+\.\d+)(.*)/, '$1');
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user