test
This commit is contained in:
@@ -16,6 +16,8 @@ export interface UserInfoState {
|
|||||||
setSelectOptionsMids: (update: SetStateAction<Array<Record<string, string>>>) => void;
|
setSelectOptionsMids: (update: SetStateAction<Array<Record<string, string>>>) => void;
|
||||||
mid: string;
|
mid: string;
|
||||||
setMid: (update: SetStateAction<string>) => void;
|
setMid: (update: SetStateAction<string>) => void;
|
||||||
|
firstAccess: boolean;
|
||||||
|
setFirstAccess: (update: SetStateAction<boolean>) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
const initialUserInfoState = {
|
const initialUserInfoState = {
|
||||||
@@ -23,7 +25,8 @@ const initialUserInfoState = {
|
|||||||
userFavorite: [] as Array<UserFavorite>,
|
userFavorite: [] as Array<UserFavorite>,
|
||||||
userMids: [] as Array<string>,
|
userMids: [] as Array<string>,
|
||||||
selectOptionsMids: [] as Array<Record<string, string>>,
|
selectOptionsMids: [] as Array<Record<string, string>>,
|
||||||
mid: '' as string
|
mid: '' as string,
|
||||||
|
firstAccess: true as boolean,
|
||||||
} as UserInfoState;
|
} as UserInfoState;
|
||||||
|
|
||||||
export const createUserInfoStore = lens<UserInfoState>((set, get) => ({
|
export const createUserInfoStore = lens<UserInfoState>((set, get) => ({
|
||||||
@@ -85,7 +88,6 @@ export const createUserInfoStore = lens<UserInfoState>((set, get) => ({
|
|||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
selectOptionsMids: [
|
selectOptionsMids: [
|
||||||
...state.selectOptionsMids,
|
|
||||||
...newSelectOptionsMids
|
...newSelectOptionsMids
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
@@ -94,11 +96,21 @@ export const createUserInfoStore = lens<UserInfoState>((set, get) => ({
|
|||||||
setMid: (update) => {
|
setMid: (update) => {
|
||||||
set((state: UserInfoState) => {
|
set((state: UserInfoState) => {
|
||||||
const newMid = (typeof update === 'function')
|
const newMid = (typeof update === 'function')
|
||||||
? update(state.mid): update;
|
? update(state.mid): update;
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
mid: newMid
|
mid: newMid
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
setFirstAccess: (update) => {
|
||||||
|
set((state: UserInfoState) => {
|
||||||
|
const newFirstAccess = (typeof update === 'function')
|
||||||
|
? update(state.firstAccess): update;
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
firstAccess: newFirstAccess
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -24,13 +24,8 @@ export const setHomeReloadKey = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const HomePage = () => {
|
export const HomePage = () => {
|
||||||
|
const { openBiometricRegistrationPopup } = useAppBridge();
|
||||||
|
|
||||||
const {
|
|
||||||
isNativeEnvironment,
|
|
||||||
openBiometricRegistrationPopup,
|
|
||||||
requestToken,
|
|
||||||
logout
|
|
||||||
} = useAppBridge();
|
|
||||||
useSetHeaderTitle('');
|
useSetHeaderTitle('');
|
||||||
useSetHeaderType(HeaderType.Home);
|
useSetHeaderType(HeaderType.Home);
|
||||||
useSetFooterMode(true);
|
useSetFooterMode(true);
|
||||||
@@ -65,8 +60,16 @@ export const HomePage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
let firstAccess = useStore.getState().UserStore.firstAccess;
|
||||||
checkBottomBannerOpen();
|
checkBottomBannerOpen();
|
||||||
checkAuthRegisterOpen();
|
|
||||||
|
if(!!firstAccess){
|
||||||
|
checkAuthRegisterOpen();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
useStore.getState().UserStore.setFirstAccess(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
let userFavorite = useStore.getState().UserStore.userFavorite;
|
let userFavorite = useStore.getState().UserStore.userFavorite;
|
||||||
setFavoriteItems(userFavorite);
|
setFavoriteItems(userFavorite);
|
||||||
|
|||||||
Reference in New Issue
Block a user