fix: race condition on frq when newly logged in

This commit is contained in:
mae taylor 2025-07-23 20:50:49 +01:00
parent 671c45085d
commit 389f8dcaff
Signed by: mae
GPG key ID: 3C80D76BA7A3B9BD

View file

@ -30,7 +30,6 @@
const VERSION = APP_VERSION;
const COMMIT = APP_COMMIT;
const lang = Lang();
const dispatch = createEventDispatcher();
function gotoProfile() {
@ -63,9 +62,13 @@
goto("/");
}
onMount(async () => {
await fetchFollowRequests(true)
})
// fetch follow requests
let frqsFetched = false;
$: if($account && !frqsFetched) {
fetchFollowRequests(true);
frqsFetched = true;
}
</script>
<div id="navigation">
@ -98,7 +101,7 @@
</span>
{/if}
</Button>
{#if $followRequests.length > 0}
{#if $followRequests && $followRequests.length > 0}
<Button label="{lang.string('navigation.follow_requests')}"
href="/follow-requests"}
active={$page.url.pathname === "/follow-requests"}>