[251210] fix: 백화현상디버깅-App.js commonActions.js 원복
🕐 커밋 시간: 2025. 12. 10. 10:01:38 📊 변경 통계: • 총 파일: 2개 • 추가: +16줄 • 삭제: -14줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/App/App.js ~ com.twin.app.shoptime/src/actions/commonActions.js 🔧 함수 변경 내용: 📄 com.twin.app.shoptime/src/App/App.js (javascript): ✅ Added: AppBase(), keyDownEvent(), mouseMoveEvent() 🔄 Modified: function() 📄 com.twin.app.shoptime/src/actions/commonActions.js (javascript): 🔄 Modified: alertToast(), setFocus(), cancelFocusElement(), addReservation(), Job() 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선
This commit is contained in:
@@ -407,8 +407,6 @@ Spotlight.silentlyFocus = function (...args) {
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Spotlight Focus 추적 로그 [251115]
|
||||
// DOM 이벤트 리스너로 대체
|
||||
|
||||
@@ -427,7 +425,7 @@ Spotlight.silentlyFocus = function (...args) {
|
||||
// });
|
||||
// }
|
||||
|
||||
function AppBase(_props /* eslint-disable-line no-unused-vars */) {
|
||||
function AppBase(props) {
|
||||
const dispatch = useDispatch();
|
||||
const httpHeader = useSelector((state) => state.common.httpHeader);
|
||||
const httpHeaderRef = useRef(httpHeader);
|
||||
@@ -629,7 +627,7 @@ function AppBase(_props /* eslint-disable-line no-unused-vars */) {
|
||||
clearLaunchParams();
|
||||
}
|
||||
},
|
||||
[dispatch],
|
||||
[dispatch]
|
||||
);
|
||||
|
||||
const handleRelaunchEvent = useCallback(() => {
|
||||
@@ -683,7 +681,7 @@ function AppBase(_props /* eslint-disable-line no-unused-vars */) {
|
||||
if (typeof window === 'object' && window.PalmSystem) {
|
||||
window.PalmSystem.activate();
|
||||
}
|
||||
}, [initService, introTermsAgreeRef,dispatch]);
|
||||
}, [initService, introTermsAgreeRef, dispatch]);
|
||||
|
||||
const visibilityChanged = useCallback(() => {
|
||||
// console.log('document is hidden', document.hidden);
|
||||
@@ -727,7 +725,7 @@ function AppBase(_props /* eslint-disable-line no-unused-vars */) {
|
||||
}, [dispatch]);
|
||||
|
||||
useEffect(() => {
|
||||
const keyDownEvent = (_event /* eslint-disable-line no-unused-vars */) => {
|
||||
const keyDownEvent = (event) => {
|
||||
dispatch(changeAppStatus({ cursorVisible: false }));
|
||||
Spotlight.setPointerMode(false);
|
||||
};
|
||||
@@ -736,7 +734,7 @@ function AppBase(_props /* eslint-disable-line no-unused-vars */) {
|
||||
let lastMoveTime = 0;
|
||||
const THROTTLE_MS = 100;
|
||||
|
||||
const mouseMoveEvent = (_event /* eslint-disable-line no-unused-vars */) => {
|
||||
const mouseMoveEvent = (event) => {
|
||||
const now = Date.now();
|
||||
if (now - lastMoveTime < THROTTLE_MS) {
|
||||
// throttle 기간 내에는 hideCursor만 재시작
|
||||
@@ -789,7 +787,9 @@ function AppBase(_props /* eslint-disable-line no-unused-vars */) {
|
||||
let userDataChanged = false;
|
||||
if (JSON.stringify(loginUserDataRef.current) !== JSON.stringify(loginUserData)) {
|
||||
userDataChanged = true;
|
||||
} else if (userDataChanged || httpHeaderRef.current === null) {
|
||||
}
|
||||
if (!httpHeader || !deviceId) {
|
||||
} else if (userDataChanged || httpHeaderRef.current === null) {
|
||||
//계정정보 변경시 또는 초기 로딩시
|
||||
if (!httpHeader) {
|
||||
dispatch(
|
||||
|
||||
@@ -122,7 +122,7 @@ export const alertToast = (payload) => (dispatch) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const getSystemSettings = () => (dispatch) => {
|
||||
export const getSystemSettings = () => (dispatch, getState) => {
|
||||
dlog('getSystemSettings ');
|
||||
lunaSend.getSystemSettings(
|
||||
{ category: 'caption', keys: ['captionEnable'] },
|
||||
@@ -146,7 +146,7 @@ export const getSystemSettings = () => (dispatch) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const getHttpHeaderForServiceRequest = () => (dispatch, getState) => {
|
||||
export const getHttpHeaderForServiceRequest = (onComplete) => (dispatch, getState) => {
|
||||
dlog('getHttpHeaderForServiceRequest ');
|
||||
const { serverType, ricCodeSetting, languageSetting } = getState().localSettings;
|
||||
lunaSend.getHttpHeaderForServiceRequest({
|
||||
@@ -285,7 +285,7 @@ export const getHttpHeaderForServiceRequest = () => (dispatch, getState) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getDeviceId = (onComplete) => (dispatch) => {
|
||||
export const getDeviceId = (onComplete) => (dispatch, getState) => {
|
||||
lunaSend.getDeviceId(
|
||||
{ idType: ['LGUDID'] },
|
||||
{
|
||||
@@ -463,7 +463,7 @@ export const setFocus = (spotlightId) => ({
|
||||
payload: spotlightId,
|
||||
});
|
||||
|
||||
export const focusElement = (spotlightId) => (dispatch) => {
|
||||
export const focusElement = (spotlightId) => (dispatch, getState) => {
|
||||
dispatch(setFocus(spotlightId));
|
||||
|
||||
if (typeof window === 'object') {
|
||||
@@ -485,7 +485,7 @@ export const cancelFocusElement = () => () => {
|
||||
let broadcastTimer = null;
|
||||
export const sendBroadCast =
|
||||
({ type, moreInfo }) =>
|
||||
(dispatch) => {
|
||||
(dispatch, getState) => {
|
||||
clearTimeout(broadcastTimer);
|
||||
dispatch(changeBroadcastEvent({ type, moreInfo }));
|
||||
broadcastTimer = setTimeout(() => {
|
||||
@@ -542,7 +542,7 @@ export const addReservation = (data) => (dispatch) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteReservationCallback = (scheduleIdList) => () => {
|
||||
export const deleteReservationCallback = (scheduleIdList) => (dispatch) => {
|
||||
lunaSend.deleteReservationCallback(scheduleIdList, {
|
||||
onSuccess: (res) => {
|
||||
// dispatch(alertToast("success" + JSON.stringify(res)));
|
||||
@@ -680,7 +680,7 @@ let updateNetworkStateJob = new Job((dispatch, connected) => {
|
||||
dispatch(changeAppStatus({ isInternetConnected: connected }));
|
||||
});
|
||||
|
||||
export const getConnectionStatus = () => (dispatch) => {
|
||||
export const getConnectionStatus = () => (dispatch, getState) => {
|
||||
lunaSend.getConnectionStatus({
|
||||
onSuccess: (res) => {
|
||||
dlog('lunasend getConnectionStatus', res);
|
||||
@@ -709,7 +709,7 @@ export const getConnectionStatus = () => (dispatch) => {
|
||||
};
|
||||
|
||||
// macAddress
|
||||
export const getConnectionInfo = () => (dispatch) => {
|
||||
export const getConnectionInfo = () => (dispatch, getState) => {
|
||||
lunaSend.getConnectionInfo({
|
||||
onSuccess: (res) => {
|
||||
dlog('lunasend getConnectionStatus', res);
|
||||
@@ -731,7 +731,7 @@ export const getConnectionInfo = () => (dispatch) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const disableNotification = () => {
|
||||
export const disableNotification = () => (dispatch, getState) => {
|
||||
lunaSend.disableNotification({
|
||||
onSuccess: (res) => {
|
||||
dlog('lunasend disable notification success', res);
|
||||
@@ -745,7 +745,7 @@ export const disableNotification = () => {
|
||||
});
|
||||
};
|
||||
|
||||
export const enableNotification = () => {
|
||||
export const enableNotification = () => (dispatch, getState) => {
|
||||
lunaSend.enableNotification({
|
||||
onSuccess: (res) => {
|
||||
dlog('lunasend enable notification success', res);
|
||||
|
||||
Reference in New Issue
Block a user