From 32c13d4c995b602fa841836c07615bddc4b77b4d Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Sun, 12 May 2024 17:44:32 -1000 Subject: [PATCH] fix: :bug: Fixes with not refreshing localStorage me value --- app.vue | 12 ++++++++++++ components/composer/composer.vue | 10 +++++----- composables/CustomEmojis.ts | 7 +++++++ pages/oauth/consent.vue | 3 +-- 4 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 composables/CustomEmojis.ts diff --git a/app.vue b/app.vue index f0ee7fa..dd4df2e 100644 --- a/app.vue +++ b/app.vue @@ -22,6 +22,7 @@ const client = useMegalodon(tokenData); const instance = useInstance(client); const description = useExtendedDescription(client); const me = useMe(); +const customEmojis = useCustomEmojis(client); useSeoMeta({ titleTemplate: (titleChunk) => { @@ -82,6 +83,17 @@ watch( }, { immediate: true }, ); + +// Refresh custom emojis and instance data and me on every reload +if (tokenData.value) { + await client.value?.verifyAccountCredentials().then((res) => { + me.value = res.data; + }); +} + +client.value?.getInstanceCustomEmojis().then((res) => { + customEmojis.value = res.data; +});