[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;
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Spotlight Focus 추적 로그 [251115]
|
// Spotlight Focus 추적 로그 [251115]
|
||||||
// DOM 이벤트 리스너로 대체
|
// 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 dispatch = useDispatch();
|
||||||
const httpHeader = useSelector((state) => state.common.httpHeader);
|
const httpHeader = useSelector((state) => state.common.httpHeader);
|
||||||
const httpHeaderRef = useRef(httpHeader);
|
const httpHeaderRef = useRef(httpHeader);
|
||||||
@@ -629,7 +627,7 @@ function AppBase(_props /* eslint-disable-line no-unused-vars */) {
|
|||||||
clearLaunchParams();
|
clearLaunchParams();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[dispatch],
|
[dispatch]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleRelaunchEvent = useCallback(() => {
|
const handleRelaunchEvent = useCallback(() => {
|
||||||
@@ -683,7 +681,7 @@ function AppBase(_props /* eslint-disable-line no-unused-vars */) {
|
|||||||
if (typeof window === 'object' && window.PalmSystem) {
|
if (typeof window === 'object' && window.PalmSystem) {
|
||||||
window.PalmSystem.activate();
|
window.PalmSystem.activate();
|
||||||
}
|
}
|
||||||
}, [initService, introTermsAgreeRef,dispatch]);
|
}, [initService, introTermsAgreeRef, dispatch]);
|
||||||
|
|
||||||
const visibilityChanged = useCallback(() => {
|
const visibilityChanged = useCallback(() => {
|
||||||
// console.log('document is hidden', document.hidden);
|
// console.log('document is hidden', document.hidden);
|
||||||
@@ -727,7 +725,7 @@ function AppBase(_props /* eslint-disable-line no-unused-vars */) {
|
|||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const keyDownEvent = (_event /* eslint-disable-line no-unused-vars */) => {
|
const keyDownEvent = (event) => {
|
||||||
dispatch(changeAppStatus({ cursorVisible: false }));
|
dispatch(changeAppStatus({ cursorVisible: false }));
|
||||||
Spotlight.setPointerMode(false);
|
Spotlight.setPointerMode(false);
|
||||||
};
|
};
|
||||||
@@ -736,7 +734,7 @@ function AppBase(_props /* eslint-disable-line no-unused-vars */) {
|
|||||||
let lastMoveTime = 0;
|
let lastMoveTime = 0;
|
||||||
const THROTTLE_MS = 100;
|
const THROTTLE_MS = 100;
|
||||||
|
|
||||||
const mouseMoveEvent = (_event /* eslint-disable-line no-unused-vars */) => {
|
const mouseMoveEvent = (event) => {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
if (now - lastMoveTime < THROTTLE_MS) {
|
if (now - lastMoveTime < THROTTLE_MS) {
|
||||||
// throttle 기간 내에는 hideCursor만 재시작
|
// throttle 기간 내에는 hideCursor만 재시작
|
||||||
@@ -789,7 +787,9 @@ function AppBase(_props /* eslint-disable-line no-unused-vars */) {
|
|||||||
let userDataChanged = false;
|
let userDataChanged = false;
|
||||||
if (JSON.stringify(loginUserDataRef.current) !== JSON.stringify(loginUserData)) {
|
if (JSON.stringify(loginUserDataRef.current) !== JSON.stringify(loginUserData)) {
|
||||||
userDataChanged = true;
|
userDataChanged = true;
|
||||||
} else if (userDataChanged || httpHeaderRef.current === null) {
|
}
|
||||||
|
if (!httpHeader || !deviceId) {
|
||||||
|
} else if (userDataChanged || httpHeaderRef.current === null) {
|
||||||
//계정정보 변경시 또는 초기 로딩시
|
//계정정보 변경시 또는 초기 로딩시
|
||||||
if (!httpHeader) {
|
if (!httpHeader) {
|
||||||
dispatch(
|
dispatch(
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export const alertToast = (payload) => (dispatch) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getSystemSettings = () => (dispatch) => {
|
export const getSystemSettings = () => (dispatch, getState) => {
|
||||||
dlog('getSystemSettings ');
|
dlog('getSystemSettings ');
|
||||||
lunaSend.getSystemSettings(
|
lunaSend.getSystemSettings(
|
||||||
{ category: 'caption', keys: ['captionEnable'] },
|
{ 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 ');
|
dlog('getHttpHeaderForServiceRequest ');
|
||||||
const { serverType, ricCodeSetting, languageSetting } = getState().localSettings;
|
const { serverType, ricCodeSetting, languageSetting } = getState().localSettings;
|
||||||
lunaSend.getHttpHeaderForServiceRequest({
|
lunaSend.getHttpHeaderForServiceRequest({
|
||||||
@@ -285,7 +285,7 @@ export const getHttpHeaderForServiceRequest = () => (dispatch, getState) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getDeviceId = (onComplete) => (dispatch) => {
|
export const getDeviceId = (onComplete) => (dispatch, getState) => {
|
||||||
lunaSend.getDeviceId(
|
lunaSend.getDeviceId(
|
||||||
{ idType: ['LGUDID'] },
|
{ idType: ['LGUDID'] },
|
||||||
{
|
{
|
||||||
@@ -463,7 +463,7 @@ export const setFocus = (spotlightId) => ({
|
|||||||
payload: spotlightId,
|
payload: spotlightId,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const focusElement = (spotlightId) => (dispatch) => {
|
export const focusElement = (spotlightId) => (dispatch, getState) => {
|
||||||
dispatch(setFocus(spotlightId));
|
dispatch(setFocus(spotlightId));
|
||||||
|
|
||||||
if (typeof window === 'object') {
|
if (typeof window === 'object') {
|
||||||
@@ -485,7 +485,7 @@ export const cancelFocusElement = () => () => {
|
|||||||
let broadcastTimer = null;
|
let broadcastTimer = null;
|
||||||
export const sendBroadCast =
|
export const sendBroadCast =
|
||||||
({ type, moreInfo }) =>
|
({ type, moreInfo }) =>
|
||||||
(dispatch) => {
|
(dispatch, getState) => {
|
||||||
clearTimeout(broadcastTimer);
|
clearTimeout(broadcastTimer);
|
||||||
dispatch(changeBroadcastEvent({ type, moreInfo }));
|
dispatch(changeBroadcastEvent({ type, moreInfo }));
|
||||||
broadcastTimer = setTimeout(() => {
|
broadcastTimer = setTimeout(() => {
|
||||||
@@ -542,7 +542,7 @@ export const addReservation = (data) => (dispatch) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deleteReservationCallback = (scheduleIdList) => () => {
|
export const deleteReservationCallback = (scheduleIdList) => (dispatch) => {
|
||||||
lunaSend.deleteReservationCallback(scheduleIdList, {
|
lunaSend.deleteReservationCallback(scheduleIdList, {
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
// dispatch(alertToast("success" + JSON.stringify(res)));
|
// dispatch(alertToast("success" + JSON.stringify(res)));
|
||||||
@@ -680,7 +680,7 @@ let updateNetworkStateJob = new Job((dispatch, connected) => {
|
|||||||
dispatch(changeAppStatus({ isInternetConnected: connected }));
|
dispatch(changeAppStatus({ isInternetConnected: connected }));
|
||||||
});
|
});
|
||||||
|
|
||||||
export const getConnectionStatus = () => (dispatch) => {
|
export const getConnectionStatus = () => (dispatch, getState) => {
|
||||||
lunaSend.getConnectionStatus({
|
lunaSend.getConnectionStatus({
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
dlog('lunasend getConnectionStatus', res);
|
dlog('lunasend getConnectionStatus', res);
|
||||||
@@ -709,7 +709,7 @@ export const getConnectionStatus = () => (dispatch) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// macAddress
|
// macAddress
|
||||||
export const getConnectionInfo = () => (dispatch) => {
|
export const getConnectionInfo = () => (dispatch, getState) => {
|
||||||
lunaSend.getConnectionInfo({
|
lunaSend.getConnectionInfo({
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
dlog('lunasend getConnectionStatus', res);
|
dlog('lunasend getConnectionStatus', res);
|
||||||
@@ -731,7 +731,7 @@ export const getConnectionInfo = () => (dispatch) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const disableNotification = () => {
|
export const disableNotification = () => (dispatch, getState) => {
|
||||||
lunaSend.disableNotification({
|
lunaSend.disableNotification({
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
dlog('lunasend disable notification success', res);
|
dlog('lunasend disable notification success', res);
|
||||||
@@ -745,7 +745,7 @@ export const disableNotification = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const enableNotification = () => {
|
export const enableNotification = () => (dispatch, getState) => {
|
||||||
lunaSend.enableNotification({
|
lunaSend.enableNotification({
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
dlog('lunasend enable notification success', res);
|
dlog('lunasend enable notification success', res);
|
||||||
|
|||||||
Reference in New Issue
Block a user