Skip to content

Commit 84a4a91

Browse files
committed
found error, actual error
1 parent 03bce55 commit 84a4a91

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

src/containers/WebComponentLoader.jsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ const WebComponentLoader = (props) => {
8181
? JSON.parse(localStorage.getItem(authKey))
8282
: null;
8383
const user = useSelector((state) => state.auth.user || localStorageUser);
84-
const [loadRemix, setLoadRemix] = useState(!!user);
8584
const project = useSelector((state) => state.editor.project);
8685
const projectOwner = useSelector((state) => state.editor.project.user_name);
8786
const loading = useSelector((state) => state.editor.loading);
8887
const justLoaded = useSelector((state) => state.editor.justLoaded);
8988
const remixLoadFailed = useSelector((state) => state.editor.remixLoadFailed);
89+
const loadRemix = !remixLoadFailed && !!user;
9090
const hasShownSavePrompt = useSelector(
9191
(state) => state.editor.hasShownSavePrompt,
9292
);
@@ -119,14 +119,6 @@ const WebComponentLoader = (props) => {
119119
}
120120
}, [theme, setCookie, dispatch]);
121121

122-
useEffect(() => {
123-
if (remixLoadFailed) {
124-
setLoadRemix(false);
125-
} else {
126-
setLoadRemix(!!user);
127-
}
128-
}, [user, project, remixLoadFailed]);
129-
130122
useEffect(() => {
131123
if (loading === "idle" && project.identifier) {
132124
setProjectIdentifier(project.identifier);

src/containers/WebComponentLoader.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jest.mock("../hooks/useProjectPersistence", () => ({
2525
useProjectPersistence: jest.fn(),
2626
}));
2727

28-
const mockedChangeLanguage = jest.fn(() => new Promise(() => {}));
28+
const mockedChangeLanguage = jest.fn(() => Promise.resolve());
2929

3030
jest.mock("react-i18next", () => ({
3131
useTranslation: () => {

0 commit comments

Comments
 (0)