prevent launching animation when httpHeader changed
This commit is contained in:
@@ -66,6 +66,7 @@ const disableConsole = () => {
|
||||
function AppBase(props) {
|
||||
const dispatch = useDispatch();
|
||||
const httpHeader = useSelector((state) => state.common.httpHeader);
|
||||
const httpHeaderRef = useRef(httpHeader);
|
||||
const webOSVersion = useSelector(
|
||||
(state) => state.common.appStatus.webOSVersion
|
||||
);
|
||||
@@ -73,6 +74,7 @@ function AppBase(props) {
|
||||
const loginUserData = useSelector(
|
||||
(state) => state.common.appStatus.loginUserData
|
||||
);
|
||||
const loginUserDataRef = useRef(loginUserData);
|
||||
const cursorVisible = useSelector(
|
||||
(state) => state.common.appStatus.cursorVisible
|
||||
);
|
||||
@@ -233,9 +235,14 @@ function AppBase(props) {
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("httpHeader changed ", httpHeader);
|
||||
let userDataChanged = false;
|
||||
if (
|
||||
JSON.stringify(loginUserDataRef.current) !== JSON.stringify(loginUserData)
|
||||
) {
|
||||
userDataChanged = true;
|
||||
}
|
||||
if (!httpHeader || !deviceId) {
|
||||
} else {
|
||||
} else if (userDataChanged || httpHeaderRef.current === null) {
|
||||
//계정정보 변경시 또는 초기 로딩시
|
||||
dispatch(
|
||||
changeAppStatus({ showLoadingPanel: { show: true, type: "launching" } })
|
||||
@@ -257,6 +264,8 @@ function AppBase(props) {
|
||||
dispatch(getShoptimeTerms());
|
||||
}
|
||||
}
|
||||
httpHeaderRef.current = httpHeader;
|
||||
loginUserDataRef.current = loginUserData;
|
||||
}, [httpHeader, deviceId, webOSVersion]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user