mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 18:19:43 +00:00
fix(mobile): statically load paired unlock state
This commit is contained in:
1 parent
1c4ec2b412
commit
029a90b338
1 file changed
+2
-2
@@ -5,6 +5,7 @@ import { coupleApi } from "../lib/coupleApi";
|
||||
import { profileSettingsApi } from "../lib/profileSettingsApi";
|
||||
import { syncTimezone } from "../lib/reportedTimezone";
|
||||
import { Events } from "../lib/analytics";
|
||||
import { clearPairedUnlockSeen } from "../lib/pairedUnlockSeen";
|
||||
import type { Profile, Couple } from "@/types";
|
||||
|
||||
export interface AuthSessionSnapshot {
|
||||
@@ -206,7 +207,6 @@ export const useAuthStore = create<AuthState>((set, get) => ({
|
||||
const unlockUserId = get().user?.id;
|
||||
const unlockCoupleId = get().couple?.id ?? get().user?.couple_id ?? null;
|
||||
if (unlockUserId) {
|
||||
const { clearPairedUnlockSeen } = await import("../lib/pairedUnlockSeen");
|
||||
await clearPairedUnlockSeen(unlockUserId, unlockCoupleId);
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ export const useAuthStore = create<AuthState>((set, get) => ({
|
||||
// Clear other stores when user signs out
|
||||
if (user === null) {
|
||||
if (priorUserId) {
|
||||
void import("../lib/pairedUnlockSeen").then(({ clearPairedUnlockSeen }) => clearPairedUnlockSeen(priorUserId, priorCoupleId));
|
||||
void clearPairedUnlockSeen(priorUserId, priorCoupleId);
|
||||
}
|
||||
const { useMatchStore, usePacksStore, useMessageStore, useSubscriptionStore, useNotificationPreferencesStore, useStreakStore, useResponsesStore, useQuizStore } = getOtherStores();
|
||||
useMatchStore.getState().clearMatches();
|
||||
|
||||
Reference in new issue
Block a user