mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
refactor: ♻️ Rewrite state system to use Pinia for composer and auth
This commit is contained in:
parent
a6db9e059d
commit
b510782a30
80 changed files with 999 additions and 1011 deletions
|
|
@ -2,7 +2,7 @@
|
|||
<Tabs v-model:model-value="current">
|
||||
<TabsList>
|
||||
<TabsTrigger v-for="timeline in timelines.filter(
|
||||
i => i.requiresLogin ? !!identity : true,
|
||||
i => i.requiresLogin ? authStore.isSignedIn : true,
|
||||
)" :key="timeline.value" :value="timeline.value" :as="NuxtLink" :href="timeline.url">
|
||||
{{ timeline.name }}
|
||||
</TabsTrigger>
|
||||
|
|
@ -47,12 +47,12 @@ const timelines = [
|
|||
},
|
||||
];
|
||||
|
||||
const { beforeEach } = useRouter();
|
||||
const { path } = useRoute();
|
||||
const authStore = useAuthStore();
|
||||
|
||||
const current = computed(() => {
|
||||
if (path === "/") {
|
||||
return identity.value ? "home" : "public";
|
||||
return authStore.isSignedIn ? "home" : "public";
|
||||
}
|
||||
|
||||
const timeline = timelines.find((i) => i.url === path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue