diff --git a/src/entities/user/model/store.ts b/src/entities/user/model/store.ts index 033e437..9315456 100644 --- a/src/entities/user/model/store.ts +++ b/src/entities/user/model/store.ts @@ -16,6 +16,8 @@ export interface UserInfoState { setSelectOptionsMids: (update: SetStateAction>>) => void; mid: string; setMid: (update: SetStateAction) => void; + firstAccess: boolean; + setFirstAccess: (update: SetStateAction) => void; }; const initialUserInfoState = { @@ -23,7 +25,8 @@ const initialUserInfoState = { userFavorite: [] as Array, userMids: [] as Array, selectOptionsMids: [] as Array>, - mid: '' as string + mid: '' as string, + firstAccess: true as boolean, } as UserInfoState; export const createUserInfoStore = lens((set, get) => ({ @@ -85,7 +88,6 @@ export const createUserInfoStore = lens((set, get) => ({ return { ...state, selectOptionsMids: [ - ...state.selectOptionsMids, ...newSelectOptionsMids ], }; @@ -94,11 +96,21 @@ export const createUserInfoStore = lens((set, get) => ({ setMid: (update) => { set((state: UserInfoState) => { const newMid = (typeof update === 'function') - ? update(state.mid): update; + ? update(state.mid): update; return { ...state, mid: newMid } }); + }, + setFirstAccess: (update) => { + set((state: UserInfoState) => { + const newFirstAccess = (typeof update === 'function') + ? update(state.firstAccess): update; + return { + ...state, + firstAccess: newFirstAccess + } + }); } })); diff --git a/src/pages/home/home-page.tsx b/src/pages/home/home-page.tsx index a032f9b..b0831af 100644 --- a/src/pages/home/home-page.tsx +++ b/src/pages/home/home-page.tsx @@ -24,13 +24,8 @@ export const setHomeReloadKey = () => { }; export const HomePage = () => { + const { openBiometricRegistrationPopup } = useAppBridge(); - const { - isNativeEnvironment, - openBiometricRegistrationPopup, - requestToken, - logout - } = useAppBridge(); useSetHeaderTitle(''); useSetHeaderType(HeaderType.Home); useSetFooterMode(true); @@ -65,8 +60,16 @@ export const HomePage = () => { }; useEffect(() => { + let firstAccess = useStore.getState().UserStore.firstAccess; checkBottomBannerOpen(); - checkAuthRegisterOpen(); + + if(!!firstAccess){ + checkAuthRegisterOpen(); + } + else{ + useStore.getState().UserStore.setFirstAccess(false); + } + let userFavorite = useStore.getState().UserStore.userFavorite; setFavoriteItems(userFavorite);