[지라이슈없음] getErrorMessage errorCode가 null일 경우 노출 안 되도록 처리
This commit is contained in:
@@ -448,13 +448,36 @@ export default function TabLayout({ topPanelName, onTabActivated, panelInfo }) {
|
|||||||
}
|
}
|
||||||
}, [showSubTab]);
|
}, [showSubTab]);
|
||||||
|
|
||||||
const spotToPanel = useCallback(() => {
|
const spotToPanelJob = useRef(
|
||||||
|
new Job(() => {
|
||||||
|
const node = document.querySelector(`[id="${SpotlightIds.TPANEL}"]`);
|
||||||
|
|
||||||
|
if (node) {
|
||||||
|
Spotlight.focus(node);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
const spotToPanel = useCallback((delayed = false) => {
|
||||||
const node = document.querySelector(`[id="${SpotlightIds.TPANEL}"]`);
|
const node = document.querySelector(`[id="${SpotlightIds.TPANEL}"]`);
|
||||||
|
|
||||||
if (node) {
|
if (node) {
|
||||||
Spotlight.focus(node);
|
if (delayed) {
|
||||||
|
spotToPanelJob.current.start(() => {
|
||||||
|
Spotlight.focus(node);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Spotlight.focus(node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
return () => {
|
||||||
|
spotToPanelJob.current.stop();
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleNavigation = useCallback(
|
const handleNavigation = useCallback(
|
||||||
({ index, target }) => {
|
({ index, target }) => {
|
||||||
setMainSelectedIndex(index);
|
setMainSelectedIndex(index);
|
||||||
@@ -481,7 +504,7 @@ export default function TabLayout({ topPanelName, onTabActivated, panelInfo }) {
|
|||||||
// 홈패널일 경우
|
// 홈패널일 경우
|
||||||
if (target && target[0]?.name === panel_names.HOME_PANEL) {
|
if (target && target[0]?.name === panel_names.HOME_PANEL) {
|
||||||
deActivateTab();
|
deActivateTab();
|
||||||
spotToPanel();
|
spotToPanel(true);
|
||||||
dispatch(resetPanels());
|
dispatch(resetPanels());
|
||||||
dispatch(checkEnterThroughGNB(true));
|
dispatch(checkEnterThroughGNB(true));
|
||||||
dispatch(resetHomeInfo());
|
dispatch(resetHomeInfo());
|
||||||
|
|||||||
@@ -547,9 +547,11 @@ export const getErrorMessage = (errorCode, retMsg, retDetailCode) => {
|
|||||||
group.codes.includes(Number(errorCode))
|
group.codes.includes(Number(errorCode))
|
||||||
);
|
);
|
||||||
|
|
||||||
const errorPrefix = retDetailCode
|
const errorPrefix = errorCode
|
||||||
? `[${errorCode}-${retDetailCode}] `
|
? retDetailCode
|
||||||
: `[${errorCode}] `;
|
? `[${errorCode}-${retDetailCode}] `
|
||||||
|
: `[${errorCode}] `
|
||||||
|
: "";
|
||||||
|
|
||||||
if (group) {
|
if (group) {
|
||||||
return errorPrefix + group.message;
|
return errorPrefix + group.message;
|
||||||
|
|||||||
Reference in New Issue
Block a user