Revert "[SHOPTIME-3325] 앱 삭제 후 재설치 시 과거 데이터 유지됨"

This reverts commit b3e1890c9d.
This commit is contained in:
hyunwoo93.cha
2025-01-14 16:05:15 +09:00
parent 537f6a9120
commit 6b64459586
4 changed files with 2 additions and 96 deletions

View File

@@ -15,7 +15,6 @@ import Spotlight from "@enact/spotlight";
import appinfo from "../../webos-meta/appinfo.json";
import { types } from "../actions/actionTypes";
import { checkAppFirstLaunch } from "../actions/appDataActions";
import {
changeAppStatus,
deleteOldDb8Datas,
@@ -133,10 +132,6 @@ function AppBase(props) {
const oldDb8Deleted = useSelector(
(state) => state.localSettings.oldDb8Deleted
);
const isFirstLaunch = useSelector((state) => state.appData.isFirstLaunch);
const isFirstLaunchChecked = useSelector(
(state) => state.appData.isFirstLaunchChecked
);
const deviceCountryCode = httpHeader?.["X-Device-Country"] || "";
@@ -155,10 +150,10 @@ function AppBase(props) {
}, [logEnable]);
useEffect(() => {
if (!oldDb8Deleted && !isFirstLaunch && isFirstLaunchChecked) {
if (!oldDb8Deleted) {
dispatch(deleteOldDb8Datas());
}
}, [oldDb8Deleted, isFirstLaunch, isFirstLaunchChecked]);
}, [oldDb8Deleted]);
const hideCursor = useRef(
new Job((func) => {
@@ -272,8 +267,6 @@ function AppBase(props) {
window.PalmSystem.activate();
window.lunaTest = (service, method, subscribe, parameters) =>
lunaTest(service, method, subscribe, parameters);
dispatch(checkAppFirstLaunch());
}
dispatch(getDeviceId());

View File

@@ -1,6 +1,5 @@
import { URLS } from "../api/apiConfig";
import { TAxios } from "../api/TAxios";
import * as lunaSend from "../lunaSend";
import { types } from "./actionTypes";
export const addMainIndex = (index) => ({
@@ -66,24 +65,3 @@ export const sendSms = (params) => (dispatch, getState) => {
export const clearSMS = () => ({
type: types.CLEAR_SMS,
});
export const checkAppFirstLaunch = () => (dispatch) => {
lunaSend.checkFirstLaunch({
onSuccess: (res) => {
const isFirstLaunch = res.results.length === 0;
dispatch({
type: types.CHECK_FIRST_LAUNCH,
payload: isFirstLaunch,
isFirstLaunchChecked: true,
});
if (isFirstLaunch) {
lunaSend.setFirstLaunch({
onSuccess: () => {
dispatch({ type: types.SET_FIRST_LAUNCH });
},
});
}
},
});
};

View File

@@ -319,55 +319,3 @@ export const deleteOldDb8 = (kind, { onSuccess, onFailure, onComplete }) => {
onComplete,
});
};
export const checkFirstLaunch = ({ onSuccess, onFailure, onComplete }) => {
if (typeof window === "object" && !window.PalmSystem) {
console.log("LUNA SEND checkFirstLaunch");
onSuccess({ results: [] });
return;
}
return new LS2Request().send({
service: "luna://com.webos.service.db",
method: "find",
parameters: {
query: {
from: "com.shoptime.app.settings:1",
where: [
{
prop: "usedApp",
op: "=",
val: true,
},
],
},
},
onSuccess,
onFailure,
onComplete,
});
};
export const setFirstLaunch = ({ onSuccess, onFailure, onComplete }) => {
if (typeof window === "object" && !window.PalmSystem) {
console.log("LUNA SEND setFirstLaunch");
onSuccess();
return;
}
return new LS2Request().send({
service: "luna://com.webos.service.db",
method: "put",
parameters: {
objects: [
{
_kind: "com.shoptime.app.settings:1",
usedApp: true,
},
],
},
onSuccess,
onFailure,
onComplete,
});
};

View File

@@ -3,8 +3,6 @@ import { types } from "../actions/actionTypes";
const initialState = {
mainIndex: null,
sendSms: {},
isFirstLaunch: null,
isFirstLaunchChecked: false,
};
export const appDataReducer = (state = initialState, action) => {
@@ -24,17 +22,6 @@ export const appDataReducer = (state = initialState, action) => {
...state,
sendSms: { retCode: undefined },
};
case types.CHECK_FIRST_LAUNCH:
return {
...state,
isFirstLaunch: action.payload,
isFirstLaunchChecked: action.isFirstLaunchChecked,
};
case types.SET_FIRST_LAUNCH:
return {
...state,
isFirstLaunch: false,
};
default:
return state;
}