This commit is contained in:
Jamie Brunton committed 2025-12-31 09:40:27 +00:00
1 parent d1a2032724
commit dfcf0ba289
10 files changed
+630 -28

No files matched your search

+9
View File
@@ -1,5 +1,6 @@
import { create } from "zustand";
import { supabase } from "../lib/supabase";
import { Events } from "../lib/analytics";
import revenueCatService, {
SubscriptionState,
PurchasesPackage,
@@ -87,6 +88,7 @@ export const useAuthStore = create<AuthState>((set, get) => ({
},
signOut: async () => {
Events.signOut();
// Clear local state FIRST to ensure UI updates even if Supabase call fails
set({
user: null,
@@ -337,6 +339,13 @@ export const usePacksStore = create<PacksState>((set, get) => ({
return { success: false, reason: "error" };
}
// Track pack enable/disable
if (newValue) {
Events.packEnabled(packId);
} else {
Events.packDisabled(packId);
}
return { success: true };
},