Skip to content

Commit

Permalink
feat: added isACIXSTOREValid func
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJustChew committed Sep 16, 2024
1 parent caf4aeb commit 77d358d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/hooks/contexts/useHeadlessAIS.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const headlessAISContext = createContext<
signIn: async () => false,
signOut: async () => {},
getACIXSTORE: async () => undefined,
isACIXSTOREValid: () => false,
openChangePassword: false,
setOpenChangePassword: () => {},
});
Expand Down Expand Up @@ -230,6 +231,11 @@ const useHeadlessAISProvider = () => {
enabled: headlessAIS.enabled,
};

const isACIXSTOREValid = () =>
headlessAIS.enabled
? headlessAIS.lastUpdated + 15 * 60 * 1000 > Date.now()
: false;

return {
user,
ais,
Expand All @@ -238,6 +244,7 @@ const useHeadlessAISProvider = () => {
signIn,
signOut,
getACIXSTORE,
isACIXSTOREValid,
initializing,
openChangePassword,
setOpenChangePassword,
Expand Down

0 comments on commit 77d358d

Please sign in to comment.