Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(auth): stop infinite updateAuthPlan loop when org fetch always fails on self-hosted

ManthanNimodiya9df1ddf2528d
diff --git a/apps/desktop/src/utils/queries.ts b/apps/desktop/src/utils/queries.ts
index 4b65b225b..fcf00fc66 100644
--- a/apps/desktop/src/utils/queries.ts
+++ b/apps/desktop/src/utils/queries.ts
@@ -351,12 +351,8 @@ export function createCustomDomainQuery() {
export function createOrganizationsQuery() {
const auth = authStore.createQuery();
- // Refresh organizations if they're missing
createEffect(() => {
- if (
- auth.data?.user_id &&
- (!auth.data?.organizations || auth.data.organizations.length === 0)
- ) {
+ if (auth.data?.user_id && !auth.data?.organizations_updated_at) {
commands.updateAuthPlan().catch(console.error);
}
});