diff --git a/app.vue b/app.vue index a33a17b..0a849df 100644 --- a/app.vue +++ b/app.vue @@ -13,13 +13,15 @@ diff --git a/bun.lockb b/bun.lockb index 0936e31..859e0db 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/buttons/DropdownElement.vue b/components/buttons/DropdownElement.vue index d4288c1..0cb7889 100644 --- a/components/buttons/DropdownElement.vue +++ b/components/buttons/DropdownElement.vue @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/components/dropdowns/AdaptiveDropdown.vue b/components/dropdowns/AdaptiveDropdown.vue index 2eb3b03..a32b510 100644 --- a/components/dropdowns/AdaptiveDropdown.vue +++ b/components/dropdowns/AdaptiveDropdown.vue @@ -39,20 +39,18 @@ const id = useId(); // HACK: Fix the menu children not reacting to touch events as click for some reason const registerClickHandlers = () => { - const targetElement = document.querySelector(`.${id}`); - if (targetElement) { - for (const el of targetElement.children) { - el.addEventListener("touchstart", (e) => { - e.stopPropagation(); - e.preventDefault(); - // Click all element children - for (const elChild of Array.from(el.children)) { - if (elChild instanceof HTMLElement) { - elChild.click(); - } + const targetElements = document.querySelectorAll(`.${id} [data-part=item]`); + for (const el of targetElements) { + el.addEventListener("touchstart", (e) => { + e.stopPropagation(); + e.preventDefault(); + // Click all element children + for (const elChild of Array.from(el.children)) { + if (elChild instanceof HTMLElement) { + elChild.click(); } - }); - } + } + }); } }; diff --git a/components/headers/greeting.vue b/components/headers/greeting.vue index ed383c5..9113735 100644 --- a/components/headers/greeting.vue +++ b/components/headers/greeting.vue @@ -1,27 +1,27 @@ \ No newline at end of file diff --git a/components/notifications/Renderer.vue b/components/notifications/Renderer.vue index 0ab9669..f9a5291 100644 --- a/components/notifications/Renderer.vue +++ b/components/notifications/Renderer.vue @@ -1,43 +1,46 @@ \ No newline at end of file diff --git a/components/sidebars/navigation.vue b/components/sidebars/navigation.vue index d414159..8f90fbf 100644 --- a/components/sidebars/navigation.vue +++ b/components/sidebars/navigation.vue @@ -1,6 +1,6 @@ @@ -109,10 +172,8 @@ useListen("composer:send-edit", (note) => { } }); -const tokenData = useTokenData(); -const isSignedIn = useSignedIn(); -const me = useMe(); -const client = useClient(tokenData); +const client = useClient(); +const identity = useCurrentIdentity(); const { loaded, note: outputtedNote, @@ -126,7 +187,16 @@ const { reblogDisplayName, } = useNoteData(noteRef, client); +const openBlank = (url: string) => window.open(url, "_blank"); + const { copy } = useClipboard(); +const isMyAccount = computed( + () => identity.value?.account.id === outputtedNote.value?.account.id, +); +const isRemote = computed(() => + outputtedNote.value?.account.acct.includes("@"), +); +const permissions = usePermissions(); const numberFormat = (number = 0) => new Intl.NumberFormat(undefined, { notation: "compact", @@ -137,7 +207,7 @@ const numberFormat = (number = 0) => const likeFn = async () => { if (!outputtedNote.value) return; if (outputtedNote.value.favourited) { - const output = await client.value?.unfavouriteStatus( + const output = await client.value.unfavouriteStatus( outputtedNote.value.id, ); @@ -145,7 +215,7 @@ const likeFn = async () => { noteRef.value = output.data; } } else { - const output = await client.value?.favouriteStatus( + const output = await client.value.favouriteStatus( outputtedNote.value.id, ); @@ -158,7 +228,7 @@ const likeFn = async () => { const reblogFn = async () => { if (!outputtedNote.value) return; if (outputtedNote.value?.reblogged) { - const output = await client.value?.unreblogStatus( + const output = await client.value.unreblogStatus( outputtedNote.value.id, ); @@ -166,7 +236,7 @@ const reblogFn = async () => { noteRef.value = output.data; } } else { - const output = await client.value?.reblogStatus(outputtedNote.value.id); + const output = await client.value.reblogStatus(outputtedNote.value.id); if (output?.data.reblog) { noteRef.value = output.data.reblog; diff --git a/components/social-elements/notes/reply-header.vue b/components/social-elements/notes/reply-header.vue index 7bd1402..c905f97 100644 --- a/components/social-elements/notes/reply-header.vue +++ b/components/social-elements/notes/reply-header.vue @@ -15,7 +15,6 @@ const props = defineProps<{ account_id: string | null; }>(); -const tokenData = useTokenData(); -const client = useClient(tokenData); +const client = useClient(); const account = useAccount(client, props.account_id); \ No newline at end of file diff --git a/components/social-elements/users/Account.vue b/components/social-elements/users/Account.vue index 8dc3eed..588a48d 100644 --- a/components/social-elements/users/Account.vue +++ b/components/social-elements/users/Account.vue @@ -9,18 +9,18 @@ class="h-32 w-32 -mt-[4.5rem] z-10 shrink-0 rounded ring-2 ring-dark-800" /> - Edit Profile + Edit Profile + v-if="account && account?.id !== identity?.account?.id && relationship && !relationship.following && !relationship.requested"> Follow + v-if="account && account?.id !== identity?.account?.id && relationship && relationship.following"> Unfollow + v-if="account && account?.id !== identity?.account?.id && relationship && !relationship.following && relationship.requested"> Requested @@ -103,14 +103,13 @@ const props = defineProps<{ }>(); const skeleton = computed(() => !props.account); -const tokenData = useTokenData(); -const me = useMe(); -const client = useClient(tokenData); +const identity = useCurrentIdentity(); +const client = useClient(); const accountId = computed(() => props.account?.id ?? null); const { relationship, isLoading } = useRelationship(client, accountId); const follow = () => { - if (!tokenData || !props.account || !relationship.value) return; + if (!identity.value || !props.account || !relationship.value) return; relationship.value = { ...relationship.value, following: true, @@ -118,7 +117,7 @@ const follow = () => { }; const unfollow = () => { - if (!tokenData || !props.account || !relationship.value) return; + if (!identity.value || !props.account || !relationship.value) return; relationship.value = { ...relationship.value, following: false, diff --git a/components/social-elements/users/SmallCard.vue b/components/social-elements/users/SmallCard.vue index 99f9a06..1a887c6 100644 --- a/components/social-elements/users/SmallCard.vue +++ b/components/social-elements/users/SmallCard.vue @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/pages/oauth/reset.vue b/pages/oauth/reset.vue index 574e982..c5574dd 100644 --- a/pages/oauth/reset.vue +++ b/pages/oauth/reset.vue @@ -67,8 +67,8 @@ import { toTypedSchema } from "@vee-validate/zod"; import { z } from "zod"; import LoginInput from "../../components/LoginInput.vue"; -const tokenData = useTokenData(); -tokenData.value = null; +const identity = useCurrentIdentity(); +identity.value = null; const schema = toTypedSchema( z diff --git a/pages/register/index.vue b/pages/register/index.vue index 0030028..11a64a0 100644 --- a/pages/register/index.vue +++ b/pages/register/index.vue @@ -1,86 +1,89 @@