Skip to content

Commit f2da262

Browse files
committed
fix(page config): defaultSelectedAppId
1 parent 9d85d2d commit f2da262

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/app-frontend/src/features/header/AppSelect.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,27 @@ export default defineComponent({
3131
immediate: true
3232
})
3333
34+
let initDefaultAppId = false
35+
3436
watch(apps, () => {
35-
if (!currentApp.value && apps.value.length) {
37+
if ((!currentApp.value || (SharedData.pageConfig?.defaultSelectedAppId && !initDefaultAppId)) && apps.value.length) {
3638
let targetId: string
3739
if (SharedData.pageConfig?.defaultSelectedAppId) {
3840
targetId = SharedData.pageConfig.defaultSelectedAppId
41+
initDefaultAppId = true
3942
} else if (currentAppId.value !== apps.value[0].id) {
4043
targetId = apps.value[0].id
4144
}
4245
if (targetId) {
4346
router.push({
4447
params: {
45-
appId: apps.value[0].id.toString()
48+
appId: targetId
4649
}
4750
})
4851
}
4952
}
53+
}, {
54+
immediate: true
5055
})
5156
5257
const { orientation } = useOrientation()

0 commit comments

Comments
 (0)