fix
This commit is contained in:
@@ -45,11 +45,18 @@ export const useVersionStore = defineStore('version', () => {
|
||||
// Полная строка версии: "Версия: 1.2.3 (build abc1234 от 2025-04-03)"
|
||||
// Принимает функцию перевода для слова "от"/"from"
|
||||
const getFormattedVersion = (t: (key: string) => string) => {
|
||||
if (!version.value) return t('common.version') + ': ...'
|
||||
if (!version.value) return t('common.version') + '...'
|
||||
const { version: ver, commitHash } = version.value
|
||||
const datePart = buildDateFormatted.value ? ` ${t('common.versionFrom')} ${buildDateFormatted.value}` : ''
|
||||
return `${t('common.version')}: ${ver} (build ${commitHash}${datePart})`
|
||||
}
|
||||
|
||||
return { version, loading, error, fetchVersion, buildDateFormatted, getFormattedVersion }
|
||||
const getShortVersion = () => {
|
||||
if (!version.value) return '...'
|
||||
const { version: ver, commitHash } = version.value
|
||||
const datePart = buildDateFormatted.value ? ` ${buildDateFormatted.value}` : ''
|
||||
return `${ver} (build ${commitHash}${datePart})`
|
||||
}
|
||||
|
||||
return { version, loading, error, fetchVersion, buildDateFormatted, getFormattedVersion, getShortVersion }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user