lg account test
This commit is contained in:
@@ -3,6 +3,7 @@ import Spotlight from "@enact/spotlight";
|
||||
import appinfo from "../../webos-meta/appinfo.json";
|
||||
import appinfo35 from "../../webos-meta/appinfo35.json";
|
||||
import appinfo79 from "../../webos-meta/appinfo79.json";
|
||||
import { handleBypassLink } from "../App/bypassLinkHandler";
|
||||
import * as lunaSend from "../lunaSend";
|
||||
import { initialLocalSettings } from "../reducers/localSettingsReducer";
|
||||
import * as Config from "../utils/Config";
|
||||
@@ -302,36 +303,45 @@ export const getTermsAgreeYn = () => (dispatch, getState) => {
|
||||
};
|
||||
|
||||
export const launchMembershipApp = () => (dispatch, getState) => {
|
||||
const webOSVersion = getState().common.appStatus.webOSVersion;
|
||||
const state = getState();
|
||||
const panels = state.panels.panels;
|
||||
const currentPanel = panels[panels.length - 1];
|
||||
|
||||
if (Number(webOSVersion) >= 9) {
|
||||
lunaSend.launchMembershipAppOver9(webOSVersion, {
|
||||
onSuccess: (res) => {
|
||||
console.log(res);
|
||||
},
|
||||
onFailure: (err) => {
|
||||
console.log(err);
|
||||
lunaSend.launchMembershipApp(webOSVersion, {
|
||||
onSuccess: (res) => {
|
||||
console.log(res);
|
||||
},
|
||||
onFailure: (err) => {
|
||||
console.log(err);
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
const returnPath = JSON.stringify({
|
||||
name: currentPanel.name,
|
||||
panelInfo: currentPanel.panelInfo || {},
|
||||
});
|
||||
|
||||
if (typeof window === "object" && !window.PalmSystem) {
|
||||
// const testBypass = {
|
||||
// name: Config.panel_names.CATEGORY_PANEL,
|
||||
// panelInfo: {
|
||||
// COUNT: 31,
|
||||
// currentSpot: null,
|
||||
// dropDownTab: 0,
|
||||
// expsOrd: 1,
|
||||
// focusedContainerId: null,
|
||||
// lgCatCd: "1017",
|
||||
// lgCatNm: "LG Electronics",
|
||||
// tab: 0,
|
||||
// },
|
||||
// };
|
||||
|
||||
console.log("returnPath", returnPath);
|
||||
// setTimeout(() => {
|
||||
// dispatch(handleBypassLink(JSON.stringify(testBypass)));
|
||||
// }, 1000);
|
||||
return;
|
||||
} else {
|
||||
lunaSend.launchMembershipApp(webOSVersion, {
|
||||
onSuccess: (res) => {
|
||||
console.log(res);
|
||||
},
|
||||
onFailure: (err) => {
|
||||
console.log(err);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
lunaSend.launchMembershipApp(returnPath, {
|
||||
onSuccess: (res) => {
|
||||
console.log("membership launch success: ", res);
|
||||
},
|
||||
onFailure: (err) => {
|
||||
console.log("membership launch failed:", err);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
let rafId = null;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import appinfo from "../../webos-meta/appinfo.json";
|
||||
import { handleBypassLink } from "../App/bypassLinkHandler";
|
||||
import { store } from "../store/store";
|
||||
import * as Config from "../utils/Config";
|
||||
import LS2Request from "./LS2Request";
|
||||
@@ -158,38 +159,37 @@ export const getLoginUserData = (
|
||||
onComplete && onComplete();
|
||||
}
|
||||
};
|
||||
export const launchMembershipAppOver9 = (
|
||||
webOSVersion,
|
||||
{ onSuccess, onFailure, onComplete }
|
||||
) => {
|
||||
if (
|
||||
typeof window === "object" &&
|
||||
window.PalmSystem &&
|
||||
process.env.REACT_APP_MODE !== "DEBUG"
|
||||
) {
|
||||
return new LS2Request().send({
|
||||
service: "luna://com.webos.applicationManager",
|
||||
method: "launchDefaultApp",
|
||||
subscribe: false,
|
||||
parameters: {
|
||||
category: "MembershipApp",
|
||||
params: {
|
||||
query: "login",
|
||||
id: window.PalmSystem.identifier ?? appinfo.id,
|
||||
reLaunch: "Y",
|
||||
},
|
||||
},
|
||||
onSuccess,
|
||||
onFailure,
|
||||
onComplete,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const launchMembershipApp = (
|
||||
webOSVersion,
|
||||
returnPath,
|
||||
{ onSuccess, onFailure, onComplete }
|
||||
) => {
|
||||
if (typeof window === "object" && !window.Palmsystem) {
|
||||
console.log("luna send launchMembershipApp");
|
||||
|
||||
/* 테스트용 */
|
||||
// setTimeout(() => {
|
||||
// const testBypass = JSON.stringify({
|
||||
// name: Config.panel_names.CATEGORY_PANEL,
|
||||
// panelInfo: {
|
||||
// COUNT: 31,
|
||||
// currentSpot: null,
|
||||
// dropDownTab: 0,
|
||||
// expsOrd: 1,
|
||||
// focusedContainerId: null,
|
||||
// lgCatCd: "1017",
|
||||
// lgCatNm: "LG Electronics",
|
||||
// tab: 0,
|
||||
// },
|
||||
// });
|
||||
|
||||
// store.dispatch(handleBypassLink(testBypass));
|
||||
|
||||
// onSuccess?.({ returnValue: true });
|
||||
// }, 1000);
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
typeof window === "object" &&
|
||||
window.PalmSystem &&
|
||||
@@ -205,6 +205,9 @@ export const launchMembershipApp = (
|
||||
query: "login",
|
||||
id: window.PalmSystem.identifier ?? appinfo.id,
|
||||
reLaunch: "Y",
|
||||
returnTo: {
|
||||
bypass: returnPath,
|
||||
},
|
||||
},
|
||||
},
|
||||
onSuccess,
|
||||
|
||||
Reference in New Issue
Block a user