fix: 界面缩放持久化被 onboarding/locale 整包写回覆盖,保存前用最新 uiScale 回填
This commit is contained in:
1 parent
ae9a762439
commit
f238eeae0e
1 file changed
+3
-1
@@ -143,7 +143,7 @@ import {
|
||||
isNetworkMetered,
|
||||
setRestartAfterPendingUpdate,
|
||||
} from '@/helpers/utils.js'
|
||||
import { installUiScale, setUiScale } from '@/helpers/ui-scale'
|
||||
import { installUiScale, setUiScale, uiScale } from '@/helpers/ui-scale'
|
||||
import { start_join_server, start_join_singleplayer_world } from '@/helpers/worlds.ts'
|
||||
import i18n, { resolveInitialLocale } from '@/i18n.config'
|
||||
import {
|
||||
@@ -1106,6 +1106,7 @@ async function setupApp() {
|
||||
const resolvedLocale = resolveInitialLocale(navigator.languages)
|
||||
i18n.global.locale.value = resolvedLocale
|
||||
initialSettings.locale = resolvedLocale
|
||||
initialSettings.ui_scale = uiScale.value
|
||||
await setSettings(initialSettings)
|
||||
}
|
||||
|
||||
@@ -1261,6 +1262,7 @@ async function replayOnboarding(mode) {
|
||||
async function finishOnboarding() {
|
||||
const wasReplay = onboardingReplay.value
|
||||
const settings = onboardingSettings.value ?? (await getSettings())
|
||||
settings.ui_scale = uiScale.value
|
||||
if (!onboardingReplay.value) {
|
||||
if (onboardingMode.value === 'instance') {
|
||||
settings.onboarding_instance_tour_completed = true
|
||||
|
||||
Reference in new issue
Block a user