Skip to content

Commit

Permalink
Small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
david-mears-2 committed Nov 13, 2024
1 parent fdeeb7c commit d98c08a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function handleToggleSidebarVisibility() {
const pagesUsingGlobe = ["scenarios-runId", "scenarios-new"];
// Hide/show the component separately from loading it. We want to load either 0 or 1 times max, but show/hide it as needed.
const showGlobe = computed(() => appStore.globeParameter && appStore.largeScreen && pagesUsingGlobe.includes(route.name as string));
const showGlobe = computed(() => !!appStore.globeParameter && appStore.largeScreen && pagesUsingGlobe.includes(route.name as string));
// Set whether to load the globe component based on the current route and screen size.
const setGlobeComponent = () => {
Expand All @@ -42,7 +42,7 @@ const setGlobeComponent = () => {
if (!loadGlobeComponent.value) {
// Set the loadGlobeComponent value here, rather than using a computed property, since the app store initializes with the assumption
// that largeScreen is true, and so using a computed would mean that we always try to load the globe on the initial page load.
loadGlobeComponent.value = appStore.largeScreen && pagesUsingGlobe.includes(route.name as string);
loadGlobeComponent.value = showGlobe.value;
}
};
Expand Down

0 comments on commit d98c08a

Please sign in to comment.