diff --git a/app/app.vue b/app/app.vue index dfba819..26ceff1 100644 --- a/app/app.vue +++ b/app/app.vue @@ -2,8 +2,14 @@ const { t } = useI18n() const { user, logout } = useAuth() const notices = useNotices() -/** The world of the village or map on screen, for the Map link. */ -const currentWorld = useState('world.current', () => null) +const route = useRoute() +const { current } = useCurrentWorld() + +/** Inside a world (village or map) the header is that world's navigation. */ +const inWorld = computed(() => !!current.value && /^\/(village|map)\//.test(route.path)) +const home = computed(() => + inWorld.value && current.value?.villageId ? `/village/${current.value.villageId}` : '/worlds', +) const connection = computed(() => isMockServer @@ -28,7 +34,7 @@ useHead({ title: () => t('app.title') })
- + @@ -37,12 +43,17 @@ useHead({ title: () => t('app.title') }) -