diff --git a/app/mobile/src/context/useAppContext.hook.js b/app/mobile/src/context/useAppContext.hook.js index f13365ea..65c32387 100644 --- a/app/mobile/src/context/useAppContext.hook.js +++ b/app/mobile/src/context/useAppContext.hook.js @@ -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 () => { diff --git a/app/mobile/src/context/useStoreContext.hook.js b/app/mobile/src/context/useStoreContext.hook.js index d349eb08..737b0ad1 100644 --- a/app/mobile/src/context/useStoreContext.hook.js +++ b/app/mobile/src/context/useStoreContext.hook.js @@ -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`;