fix: 🐛 Fix infinite refresh of account cache

This commit is contained in:
Jesse Wierzbinski 2024-11-29 21:43:41 +01:00
parent dc004601b0
commit e50a6d6f2b
No known key found for this signature in database

View file

@ -7,7 +7,9 @@ export const useCacheRefresh = (client: MaybeRef<Client | null>) => {
} }
// Refresh custom emojis and instance data and me on every reload // Refresh custom emojis and instance data and me on every reload
watchEffect(async () => { watch(
[identity, client],
async () => {
console.info("Refreshing emoji, instance and account cache"); console.info("Refreshing emoji, instance and account cache");
if (identity.value) { if (identity.value) {
toValue(client) toValue(client)
@ -64,5 +66,7 @@ export const useCacheRefresh = (client: MaybeRef<Client | null>) => {
identity.value.instance = res.data; identity.value.instance = res.data;
} }
}); });
}); },
{ flush: "sync" },
);
}; };