Skip to content

Commit

Permalink
chore: replace with new sub check
Browse files Browse the repository at this point in the history
  • Loading branch information
AykutSarac committed Feb 12, 2024
1 parent dbc198c commit d88dafc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/store/useUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ const initialStates: UserStates = {
const useUser = create<UserStates & UserActions>()(set => ({
...initialStates,
setSession: async session => {
supabase.rpc("get_subscription_info").then(({ data }) => {
supabase.rpc("get_subscription_details").then(({ data }) => {
if (data) {
set({
premium: data.premium,
organization: data.organization,
organization: data.orgPremium,
premiumCancelled: !!data.cancelled,
orgAdmin: data.org_admin,
orgAdmin: data.orgAdmin,
});

ReactGA.set({ tier: data.premium ? "premium" : "free" });
}

Expand Down

0 comments on commit d88dafc

Please sign in to comment.