Merge branch 'main' of https://gitea.bpsoft.co.kr/nicepayments/nice-app-web
This commit is contained in:
@@ -72,6 +72,9 @@ interface UseAppBridgeReturn {
|
|||||||
|
|
||||||
// 언어 설정 조회
|
// 언어 설정 조회
|
||||||
getLanguage: () => Promise<string>;
|
getLanguage: () => Promise<string>;
|
||||||
|
|
||||||
|
// 알림 링크 확인
|
||||||
|
checkAlarmLink: () => Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useAppBridge = (): UseAppBridgeReturn => {
|
export const useAppBridge = (): UseAppBridgeReturn => {
|
||||||
@@ -315,6 +318,13 @@ export const useAppBridge = (): UseAppBridgeReturn => {
|
|||||||
return appBridge.safeCall(() => appBridge.setLoginType(type));
|
return appBridge.safeCall(() => appBridge.setLoginType(type));
|
||||||
}, [isNativeEnvironment]);
|
}, [isNativeEnvironment]);
|
||||||
|
|
||||||
|
const checkAlarmLink = useCallback(async (): Promise<void> => {
|
||||||
|
if (!isNativeEnvironment) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return appBridge.safeCall(() => appBridge.checkAlarmLink());
|
||||||
|
}, [isNativeEnvironment]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isNativeEnvironment,
|
isNativeEnvironment,
|
||||||
isAndroid,
|
isAndroid,
|
||||||
@@ -342,6 +352,7 @@ export const useAppBridge = (): UseAppBridgeReturn => {
|
|||||||
setLoginType,
|
setLoginType,
|
||||||
getNotificationSetting,
|
getNotificationSetting,
|
||||||
setNotificationSetting,
|
setNotificationSetting,
|
||||||
getLanguage
|
getLanguage,
|
||||||
|
checkAlarmLink
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -18,11 +18,11 @@ import {
|
|||||||
import { useStore } from '@/shared/model/store';
|
import { useStore } from '@/shared/model/store';
|
||||||
import { UserFavorite } from '@/entities/user/model/types';
|
import { UserFavorite } from '@/entities/user/model/types';
|
||||||
import { useHomeBannerListMutation } from '@/entities/home/api/use-home-banner-list-mutation';
|
import { useHomeBannerListMutation } from '@/entities/home/api/use-home-banner-list-mutation';
|
||||||
import {
|
import {
|
||||||
BannerList,
|
BannerList,
|
||||||
BannerType,
|
BannerType,
|
||||||
HomeBannerListParams,
|
HomeBannerListParams,
|
||||||
HomeBannerListResponse
|
HomeBannerListResponse
|
||||||
} from '@/entities/home/model/types';
|
} from '@/entities/home/model/types';
|
||||||
|
|
||||||
export let homeReloadKey = 1;
|
export let homeReloadKey = 1;
|
||||||
@@ -31,7 +31,7 @@ export const setHomeReloadKey = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const HomePage = () => {
|
export const HomePage = () => {
|
||||||
const { openBiometricRegistrationPopup } = useAppBridge();
|
const { openBiometricRegistrationPopup, checkAlarmLink } = useAppBridge();
|
||||||
const { mutateAsync: homeBannerList } = useHomeBannerListMutation();
|
const { mutateAsync: homeBannerList } = useHomeBannerListMutation();
|
||||||
|
|
||||||
useSetHeaderTitle('');
|
useSetHeaderTitle('');
|
||||||
@@ -44,7 +44,7 @@ export const HomePage = () => {
|
|||||||
|
|
||||||
const [bottomBannerOn, setBottomBannerOn] = useState<boolean>(false);
|
const [bottomBannerOn, setBottomBannerOn] = useState<boolean>(false);
|
||||||
const [authRegisterOn, setAuthRegisterOn] = useState<boolean>(false);
|
const [authRegisterOn, setAuthRegisterOn] = useState<boolean>(false);
|
||||||
const [favoriteItems, setFavoriteItems] = useState<Array<UserFavorite>>([]);
|
const [, setFavoriteItems] = useState<Array<UserFavorite>>([]);
|
||||||
const [bannerList, setBannerList] = useState<Array<BannerList>>([]);
|
const [bannerList, setBannerList] = useState<Array<BannerList>>([]);
|
||||||
|
|
||||||
const callHomeBannerList = () => {
|
const callHomeBannerList = () => {
|
||||||
@@ -75,7 +75,7 @@ export const HomePage = () => {
|
|||||||
|
|
||||||
|
|
||||||
const checkBottomBannerOpen = () => {
|
const checkBottomBannerOpen = () => {
|
||||||
if(!!bannerToday){
|
if(bannerToday){
|
||||||
bannerToday = bannerToday.toString();
|
bannerToday = bannerToday.toString();
|
||||||
}
|
}
|
||||||
let sw = (today !== bannerToday);
|
let sw = (today !== bannerToday);
|
||||||
@@ -87,31 +87,31 @@ export const HomePage = () => {
|
|||||||
setAuthRegisterOn(true);
|
setAuthRegisterOn(true);
|
||||||
}
|
}
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log('catch', e);
|
console.log('catch', e);
|
||||||
|
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
console.log('finally');
|
console.log('finally');
|
||||||
setAuthRegisterOn(true);
|
setAuthRegisterOn(true);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let firstAccess = useStore.getState().UserStore.firstAccess;
|
let firstAccess = useStore.getState().UserStore.firstAccess;
|
||||||
checkBottomBannerOpen();
|
checkBottomBannerOpen();
|
||||||
|
|
||||||
if(!!firstAccess){
|
if(firstAccess){
|
||||||
checkAuthRegisterOpen();
|
checkAuthRegisterOpen();
|
||||||
|
// 알림 링크 확인
|
||||||
|
checkAlarmLink();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
useStore.getState().UserStore.setFirstAccess(false);
|
useStore.getState().UserStore.setFirstAccess(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
let userFavorite = useStore.getState().UserStore.userFavorite;
|
let userFavorite = useStore.getState().UserStore.userFavorite;
|
||||||
setFavoriteItems(userFavorite);
|
setFavoriteItems(userFavorite);
|
||||||
callHomeBannerList();
|
callHomeBannerList();
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const setBottomBannerEffect = (mode: boolean) => {
|
const setBottomBannerEffect = (mode: boolean) => {
|
||||||
|
|||||||
@@ -79,7 +79,10 @@ export enum BridgeMessageType {
|
|||||||
|
|
||||||
// 알림 수신 설정 (Android only)
|
// 알림 수신 설정 (Android only)
|
||||||
GET_NOTIFICATION_SETTING = 'getNotificationSetting',
|
GET_NOTIFICATION_SETTING = 'getNotificationSetting',
|
||||||
SET_NOTIFICATION_SETTING = 'setNotificationSetting'
|
SET_NOTIFICATION_SETTING = 'setNotificationSetting',
|
||||||
|
|
||||||
|
// 알림 링크 확인
|
||||||
|
CHECK_ALARM_LINK = 'checkAlarmLink'
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeviceInfo {
|
export interface DeviceInfo {
|
||||||
|
|||||||
@@ -225,6 +225,11 @@ class AppBridge {
|
|||||||
return this.sendMessage(BridgeMessageType.SET_NOTIFICATION_SETTING, { enabled });
|
return this.sendMessage(BridgeMessageType.SET_NOTIFICATION_SETTING, { enabled });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 알림 링크 확인
|
||||||
|
async checkAlarmLink(): Promise<void> {
|
||||||
|
return this.sendMessage(BridgeMessageType.CHECK_ALARM_LINK);
|
||||||
|
}
|
||||||
|
|
||||||
// 네이티브 환경 체크
|
// 네이티브 환경 체크
|
||||||
isNativeEnvironment(): boolean {
|
isNativeEnvironment(): boolean {
|
||||||
return !!(
|
return !!(
|
||||||
|
|||||||
Reference in New Issue
Block a user