refactor(#35): iNdEnTaTiOn

This commit is contained in:
OllyNicholass
2024-10-29 21:46:52 +00:00
parent 550d9bac18
commit d49f4b2c38
7 changed files with 49 additions and 55 deletions
+3 -4
View File
@@ -1,11 +1,10 @@
<script lang="ts">
import type { NavLinkItem } from "$lib/types/Nav/NavLinkItem";
import type { SupabaseClient } from "@supabase/supabase-js";
import SignOut from "../SignOut.svelte";
import type { NavLinkItem } from '$lib/types/Nav/NavLinkItem';
import type { SupabaseClient } from '@supabase/supabase-js';
import SignOut from '../SignOut.svelte';
export let linkItem: NavLinkItem;
export let supabase: SupabaseClient | null = null;
</script>
{#if !linkItem.isSignout}
@@ -10,7 +10,6 @@
export let isMobile: boolean;
export let supabase: SupabaseClient | null;
let isOpen = false;
</script>
@@ -12,8 +12,7 @@
if (isMobile) {
if (session) {
userAccountLinks.push(
{
userAccountLinks.push({
text: 'User', // TODO - replace with user's name - will require a database call to get the user's name - suggest setting up a user model to store user data.
isParent: true,
isUserAccount: true,
@@ -27,15 +26,12 @@
isSignout: true
}
]
}
);
});
} else {
userAccountLinks.push(
{
userAccountLinks.push({
text: 'Log in',
href: '/login'
},
);
});
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
import type { SupabaseClient } from "@supabase/supabase-js";
import type { SupabaseClient } from '@supabase/supabase-js';
export async function signOut(supabase: SupabaseClient, callback: () => void) {
// TODO use the error from the response