Update AppUpdateContext to improve version formatting and modal behavior

- Refactored the `formatFullAppVersion` function for better readability and maintainability.
- Updated modal components in `AppUpdateProvider` to set `closable` to false, enhancing user experience during update notifications.
This commit is contained in:
Tom Butcher 2026-08-09 14:16:54 +01:00
parent 3caae592f1
commit 9f8beae051

View File

@ -71,7 +71,11 @@ const formatFullAppVersion = (version, buildNumber) => {
const build = String(buildNumber || '').trim()
const buildSuffix =
!build || build === 'dev' ? 'dev' : build.startsWith('b') ? build : `b${build}`
!build || build === 'dev'
? 'dev'
: build.startsWith('b')
? build
: `b${build}`
return `v${normalizedVersion}-${buildSuffix}`
}
@ -486,6 +490,7 @@ export const AppUpdateProvider = ({ children }) => {
style={{ maxWidth: 430 }}
centered
maskClosable
closable={false}
onOk={() => setNoUpdateOpen(false)}
onCancel={() => setNoUpdateOpen(false)}
footer={[
@ -545,6 +550,7 @@ export const AppUpdateProvider = ({ children }) => {
open={Boolean(completedUpdate)}
style={{ maxWidth: 430 }}
centered
closable={false}
onCancel={() => setCompletedUpdate(null)}
footer={[
<Button