Skip to content

Commit

Permalink
use computed
Browse files Browse the repository at this point in the history
  • Loading branch information
kkuepper committed Jan 25, 2024
1 parent 20818e4 commit d4c994e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/AppToolbar.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script setup type="ts">
const route = useRoute();
const showBackButton = () => route.name !== "index" && route.name !== "search" && route.name !== "browse";
const showBackButton = computed(() => route.name !== "index" && route.name !== "search" && route.name !== "browse");
</script>

Check warning on line 4 in components/AppToolbar.vue

View check run for this annotation

Codecov / codecov/patch

components/AppToolbar.vue#L2-L4

Added lines #L2 - L4 were not covered by tests
<template>
<header
class="sticky top-0 z-20 flex justify-between border-b border-label-separator bg-white-2 backdrop-blur-md dark:bg-black-2"

Check warning on line 7 in components/AppToolbar.vue

View check run for this annotation

Codecov / codecov/patch

components/AppToolbar.vue#L7

Added line #L7 was not covered by tests
>
<div class="flex flex-row mx-5">
<div
v-if="showBackButton()"
v-if="showBackButton"
class="p-4 cursor-pointer"
@click="$router.back()"
>
Expand Down

0 comments on commit d4c994e

Please sign in to comment.