Fix build

This commit is contained in:
James Lyne 2021-05-28 14:50:32 +01:00
parent eadca7acc8
commit 74ccafefbc
4 changed files with 24 additions and 12 deletions

View File

@ -15,7 +15,7 @@
-->
<template>
<input :id="`player-${player.account}`" type="radio" name="player" v-bind:value="player" v-model="followTarget"
<input :id="`player-${player.account}`" type="radio" name="player" v-bind:value="player.account" v-model="followTarget"
@click.prevent="onInputClick" />
<label :for="`player-${player.account}`"
:class="{'player': true, 'player--hidden' : !!player.hidden, 'player--other-world': otherWorld}" :title="title"
@ -58,7 +58,7 @@ export default defineComponent({
}
}),
followTarget = computed(() => store.state.followTarget),
followTarget = computed(() => store.state.followTarget ? store.state.followTarget.account : undefined),
pan = () => {
if(!props.player.hidden) {

View File

@ -15,7 +15,7 @@
-->
<template>
<input :id="`server-${server.id}`" type="radio" name="server" v-bind:value="server" v-model="currentServer">
<input :id="`server-${server.id}`" type="radio" name="server" v-bind:value="server.id" v-model="currentServer">
<label :for="`server-${server.id}`">{{ server.label || server.id }}</label>
</template>
@ -37,10 +37,11 @@ export default defineComponent({
computed: {
currentServer: {
get() {
return useStore().state.currentServer;
const store = useStore();
return store.state.currentServer ? store.state.currentServer.id : undefined;
},
set(value) {
useStore().commit(MutationTypes.SET_CURRENT_SERVER, value.id);
set(value: string) {
useStore().commit(MutationTypes.SET_CURRENT_SERVER, value);
}
}
},

View File

@ -19,7 +19,7 @@
<template v-slot:heading>{{ heading }}</template>
<template v-slot:default>
<RadioList v-if="worlds.size" class="section__content" aria-labelledby="maps-heading">
<WorldListItem :world="world" v-for="[name, world] in worlds" :key="`${prefix}_${currentServer.id}_${name}`"></WorldListItem>
<WorldListItem :world="world" v-for="[name, world] in worlds" :key="`${prefix}_${currentServer}_${name}`"></WorldListItem>
</RadioList>
<div v-else class="section__skeleton">{{ skeletonWorlds }}</div>
</template>
@ -41,6 +41,13 @@ export default defineComponent({
WorldListItem
},
props: {
prefix: {
type: String,
default: 'map',
}
},
computed: {
heading() {
return useStore().state.messages.worldsHeading;
@ -55,7 +62,8 @@ export default defineComponent({
},
currentServer() {
return useStore().state.currentServer;
const store = useStore();
return store.state.currentServer ? store.state.currentServer.id : undefined;
}
}
});

View File

@ -19,7 +19,9 @@
<span class="world__name" aria-hidden="true">{{ world.title }}</span>
<div class="world__maps menu">
<template v-for="[key, map] in world.maps" :key="`${world.name}_${key}`">
<input :id="`${name}-${world.name}-${key}`" type="radio" :name="name" v-bind:value="map" v-model="currentMap" :aria-labelledby="`${name}-${world.name}-${key}-label`">
<input :id="`${name}-${world.name}-${key}`" type="radio" :name="name"
v-bind:value="[world.name,map.name]" v-model="currentMap"
:aria-labelledby="`${name}-${world.name}-${key}-label`">
<label :id="`${name}-${world.name}-${key}-label`" class="map" :for="`${name}-${world.name}-${key}`" :title="`${world.title} - ${map.title}`">
<SvgIcon :name="getMapIcon(map)"></SvgIcon>
</label>
@ -63,10 +65,11 @@ export default defineComponent({
computed: {
currentMap: {
get() {
return useStore().state.currentMap;
const store = useStore();
return store.state.currentMap ? `${store.state.currentMap.world.name}_${store.state.currentMap.name}` : undefined;
},
set(value) {
useStore().commit(MutationTypes.SET_CURRENT_MAP, {worldName: this.world.name, mapName: value.name});
set(value: string[]) {
useStore().commit(MutationTypes.SET_CURRENT_MAP, {worldName: value[0], mapName: value[1]});
}
}
},