reset tos on logout

This commit is contained in:
balzack 2023-03-06 23:05:03 -08:00
parent 1ad7c3ddcf
commit ed59da1803
2 changed files with 7 additions and 3 deletions

View File

@ -147,6 +147,7 @@ export function useAppContext() {
await clearSession();
access.current = null;
await store.actions.clearSession();
await store.actions.clearFirstRun();
updateState({ loggingOut: false });
},
remove: async () => {

View File

@ -44,12 +44,15 @@ export function useStoreContext() {
const dataId = `${guid}_profile`;
await db.current.executeSql("INSERT OR REPLACE INTO app (key, value) values (?, ?);", [dataId, encodeObject(profile)]);
},
getFirstRun: async (guid) => {
const firstRun = await getAppValue(db.current, `${guid}_firstrun`, { set: true });
getFirstRun: async () => {
const firstRun = await getAppValue(db.current, `firstrun`, { set: true });
return firstRun.set;
},
setFirstRun: async () => {
await db.current.executeSql("INSERT OR REPLACE INTO app (key, value) values (?, ?);", ["firstrun", encodeObject({ set: false })]);
await db.current.executeSql("INSERT OR REPLACE INTO app (key, value) values (?, ?);", [`firstrun`, encodeObject({ set: false })]);
},
clearFirstRun: async () => {
await db.current.executeSql("INSERT OR REPLACE INTO app (key, value) values (?, ?);", [`firstrun`, encodeObject({ set: true })]);
},
getCardRequestStatus: async (guid) => {
const dataId = `${guid}_card_status`;