Skip to content

Commit

Permalink
Hide context menu map list when there's no other maps to switch to
Browse files Browse the repository at this point in the history
  • Loading branch information
JLyne committed Jun 13, 2021
1 parent ae9358b commit 72ea95d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/map/MapContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<li role="none">
<button type="button" role="menuitem" @click.prevent="pan">{{ messageCenterHere }}</button>
</li>
<WorldListItem v-if="currentWorld" :world="currentWorld" name="context"></WorldListItem>
<WorldListItem v-if="currentWorld && mapCount > 1" :world="currentWorld" name="context"></WorldListItem>
</ul>
</nav>
</template>
Expand Down Expand Up @@ -63,6 +63,7 @@ export default defineComponent({
currentWorld = computed(() => store.state.currentWorld),
currentMap = computed(() => store.state.currentMap),
currentZoom = computed(() => store.state.currentZoom),
mapCount = computed(() => currentWorld.value ? currentWorld.value.maps.size : 0),
location = computed(() => {
if (!event.value) {
Expand Down Expand Up @@ -215,6 +216,7 @@ export default defineComponent({
locationLabel,
locationCopy,
currentWorld,
mapCount,
style,
pan,
Expand Down Expand Up @@ -278,4 +280,4 @@ export default defineComponent({
}
}
}
</style>
</style>

0 comments on commit 72ea95d

Please sign in to comment.