Skip to content

Commit d76d4a9

Browse files
committed
fix its complaining on editor leave request
1 parent 893f749 commit d76d4a9

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/reducers/mode.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const SET_FULL_SCREEN = 'scratch-gui/mode/SET_FULL_SCREEN';
22
const SET_PLAYER = 'scratch-gui/mode/SET_PLAYER';
3+
const EXTERNAL_NAVIGATION = 'scratch-gui/mode/EXTERNAL_NAVIGATION';
34

45
const initialState = {
56
isEmbedded: false,
@@ -31,11 +32,15 @@ const setFullScreen = function (isFullScreen) {
3132
isFullScreen: isFullScreen
3233
};
3334
};
34-
const setPlayer = function (isPlayerOnly) {
35-
//reload page (ASSUMES HASH MODE)
36-
//window.location.href = window.location.origin + "/" + window.location.hash;
37-
window.parent.postMessage({ type: "block-compiler-action", action: "communityPage", projectID: window.location.hash.replace("#","")}, "*");
38-
return {};
35+
const setPlayer = function () {
36+
window.parent.postMessage({
37+
type: 'block-compiler-action',
38+
action: 'communityPage',
39+
projectID: window.location.hash.replace('#', '')
40+
}, '*');
41+
return {
42+
type: EXTERNAL_NAVIGATION
43+
};
3944
};
4045

4146
export {

0 commit comments

Comments
 (0)