Skip to content

Commit

Permalink
Fix useRoute().name being undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ysbrandB committed Feb 2, 2025
1 parent aaf7631 commit 3bc72fb
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
<keep-alive v-if="new Date().getMonth() === 11">
<SnowFall
:class="
currentRoute === 'Screen' ||
currentRoute === 'Admin Screen' ||
currentRoute === 'Error' ||
currentRoute === 'Local Admin Screen'
$route.name === 'Screen' ||
$route.name === 'Admin Screen' ||
$route.name === 'Error' ||
$route.name === 'Local Admin Screen'
? ''
: '-z-10'
" />
</keep-alive>
<div
v-if="
currentRoute == 'Screen' ||
currentRoute == 'Admin Screen' ||
currentRoute == 'Error' ||
currentRoute == 'Local Admin Screen'
$route.name == 'Screen' ||
$route.name == 'Admin Screen' ||
$route.name == 'Error' ||
$route.name === 'Local Admin Screen'
">
<router-view v-slot="{ Component, route }">
<transition :name="route.meta.transition || ''">
Expand All @@ -32,9 +32,6 @@
</template>

<script setup>
import { useRoute } from "vue-router";
import { computed } from "vue";
// snowflake's
import SnowFall from "@/components/SnowFall";
Expand All @@ -52,9 +49,6 @@ if (
document.documentElement.classList.remove("dark");
}
const currentRoute = computed(() => {
return useRoute().name;
});
</script>

<style>
Expand Down

0 comments on commit 3bc72fb

Please sign in to comment.