@@ -6,7 +6,6 @@ import { off, on } from "@enact/core/dispatcher";
|
|||||||
|
|
||||||
import { pushPanel } from "../actions/panelActions";
|
import { pushPanel } from "../actions/panelActions";
|
||||||
import * as Config from "../utils/Config";
|
import * as Config from "../utils/Config";
|
||||||
import KeyCode from "../utils/KeyCode";
|
|
||||||
|
|
||||||
const useDebugKey = ({ isLandingPage = false }) => {
|
const useDebugKey = ({ isLandingPage = false }) => {
|
||||||
const panels = useSelector((state) => state.panels.panels);
|
const panels = useSelector((state) => state.panels.panels);
|
||||||
@@ -16,7 +15,7 @@ const useDebugKey = ({ isLandingPage = false }) => {
|
|||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const isPrdServer = useMemo(() => {
|
const isPrdServer = useMemo(() => {
|
||||||
if (typeof window === "object" && !window.PalmSystem) {
|
if(typeof window === "object" && !window.PalmSystem ){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,34 +39,14 @@ const useDebugKey = ({ isLandingPage = false }) => {
|
|||||||
if (isLandingPage && panels && panels.length > 0) {
|
if (isLandingPage && panels && panels.length > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (ev && ev.key >= 0 && ev.key <= 9) {
|
||||||
// TV 환경에서는 keyCode를 사용하고, 웹 환경에서는 key를 사용
|
|
||||||
let keyPressed = null;
|
|
||||||
|
|
||||||
// TV 환경 (webOS)에서 리모컨 숫자 키 처리
|
|
||||||
if (typeof window === "object" && window.PalmSystem) {
|
|
||||||
// TV 리모컨 숫자 키 코드 (48-57: 0-9)
|
|
||||||
if (ev.keyCode >= KeyCode.NUM_0 && ev.keyCode <= KeyCode.NUM_9) {
|
|
||||||
keyPressed = String(ev.keyCode - KeyCode.NUM_0);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 웹 환경에서 키보드 숫자 키 처리
|
|
||||||
if (ev && ev.key >= "0" && ev.key <= "9") {
|
|
||||||
keyPressed = ev.key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (keyPressed !== null) {
|
|
||||||
if (debugKey.current.length >= Config.DEBUG_KEY.length) {
|
if (debugKey.current.length >= Config.DEBUG_KEY.length) {
|
||||||
debugKey.current.shift();
|
debugKey.current.shift();
|
||||||
}
|
}
|
||||||
debugKey.current.push(keyPressed);
|
debugKey.current.push(String(ev.key));
|
||||||
|
|
||||||
if (debugKey.current.join("") === Config.DEBUG_KEY) {
|
if (debugKey.current.join("") === Config.DEBUG_KEY) {
|
||||||
debugKey.current = [];
|
debugKey.current = [];
|
||||||
dispatch(
|
dispatch(pushPanel({ name: Config.panel_names.DEBUG_PANEL, panelInfo: {} }));
|
||||||
pushPanel({ name: Config.panel_names.DEBUG_PANEL, panelInfo: {} })
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (debugKey.current.join("") === Config.TESTPANEL_KEY) {
|
if (debugKey.current.join("") === Config.TESTPANEL_KEY) {
|
||||||
debugKey.current = [];
|
debugKey.current = [];
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ export default function DebugPanel({ spotlightId }) {
|
|||||||
const appStatus = useSelector((state) => state.common.appStatus);
|
const appStatus = useSelector((state) => state.common.appStatus);
|
||||||
const httpHeader = useSelector((state) => state.common.httpHeader);
|
const httpHeader = useSelector((state) => state.common.httpHeader);
|
||||||
const localSettings = useSelector((state) => state.localSettings);
|
const localSettings = useSelector((state) => state.localSettings);
|
||||||
const deepLinkInfo = useSelector((state) => state.common.deepLinkInfo);
|
|
||||||
const secondLayerInfo = useSelector((state) => state.common.secondLayerInfo);
|
|
||||||
const infos = useMemo(() => {
|
const infos = useMemo(() => {
|
||||||
let v = [];
|
let v = [];
|
||||||
v.push({ title: "Version(App)", value: appinfo.version });
|
v.push({ title: "Version(App)", value: appinfo.version });
|
||||||
@@ -37,27 +35,8 @@ export default function DebugPanel({ spotlightId }) {
|
|||||||
v.push({ title: "httpHeader", value: JSON.stringify(httpHeader) });
|
v.push({ title: "httpHeader", value: JSON.stringify(httpHeader) });
|
||||||
v.push({ title: "href", value: window.location.href });
|
v.push({ title: "href", value: window.location.href });
|
||||||
v.push({ title: " ", value: " " });
|
v.push({ title: " ", value: " " });
|
||||||
// DeepLink 관련 정보
|
|
||||||
v.push({ title: "=== DeepLink Info ===", value: " " });
|
|
||||||
v.push({
|
|
||||||
title: "deepLinkInfo",
|
|
||||||
value: JSON.stringify(deepLinkInfo),
|
|
||||||
});
|
|
||||||
v.push({
|
|
||||||
title: "isDeepLink",
|
|
||||||
value: String(deepLinkInfo.isDeepLink),
|
|
||||||
});
|
|
||||||
v.push({
|
|
||||||
title: "contentTarget",
|
|
||||||
value: deepLinkInfo.contentTarget || "N/A",
|
|
||||||
});
|
|
||||||
v.push({
|
|
||||||
title: "secondLayerInfo",
|
|
||||||
value: JSON.stringify(secondLayerInfo),
|
|
||||||
});
|
|
||||||
v.push({ title: " ", value: " " });
|
|
||||||
return v;
|
return v;
|
||||||
}, [appStatus, httpHeader, deepLinkInfo, secondLayerInfo]);
|
}, [appStatus, httpHeader]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(setHidePopup());
|
dispatch(setHidePopup());
|
||||||
|
|||||||
Reference in New Issue
Block a user