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(); await clearSession();
access.current = null; access.current = null;
await store.actions.clearSession(); await store.actions.clearSession();
await store.actions.clearFirstRun();
updateState({ loggingOut: false }); updateState({ loggingOut: false });
}, },
remove: async () => { remove: async () => {

View File

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