From 7e7581dd34d54d90f8924c218b65373b1a73e372 Mon Sep 17 00:00:00 2001 From: Yueyu Date: Tue, 10 Aug 2021 20:52:09 +0800 Subject: [PATCH 1/3] Fix story saving --- src/editor/ScratchJr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor/ScratchJr.js b/src/editor/ScratchJr.js index 4e62c5e..7a4f246 100644 --- a/src/editor/ScratchJr.js +++ b/src/editor/ScratchJr.js @@ -374,7 +374,7 @@ export default class ScratchJr { Project.prepareToSave(currentProject, onDone); }); }, true); - } else if (ScratchJr.isEditable() && currentProject && !Project.error && changed) { + } else if (ScratchJr.isEditable() && editmode != 'storyStarter' && currentProject && !Project.error && changed) { Project.prepareToSave(currentProject, onDone); } else { if (onDone) { From a32cb2c056f4058112b630fa73b9ea69973ea982 Mon Sep 17 00:00:00 2001 From: Yueyu Date: Tue, 10 Aug 2021 20:52:57 +0800 Subject: [PATCH 2/3] set storyStarted if script is changed --- src/editor/ui/ScriptsPane.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/editor/ui/ScriptsPane.js b/src/editor/ui/ScriptsPane.js index 885cc5a..0c21f33 100644 --- a/src/editor/ui/ScriptsPane.js +++ b/src/editor/ui/ScriptsPane.js @@ -182,6 +182,8 @@ export default class ScriptsPane { var dx = localx(sc, el.left); var dy = localy(sc, el.top); ScriptsPane.blockDropped(sc, dx, dy); + // Start the story if scripts is changed. + ScratchJr.storyStart('ScriptsPane.changed'); break; case 'library': var thumb = Palette.getHittedThumb(el, gn('spritecc')); From 19e8c274678071e8e5bc96a3accab2fb90394cfd Mon Sep 17 00:00:00 2001 From: Yueyu Date: Tue, 10 Aug 2021 21:14:46 +0800 Subject: [PATCH 3/3] code lint --- src/editor/ScratchJr.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/editor/ScratchJr.js b/src/editor/ScratchJr.js index 7a4f246..40e95be 100644 --- a/src/editor/ScratchJr.js +++ b/src/editor/ScratchJr.js @@ -374,7 +374,12 @@ export default class ScratchJr { Project.prepareToSave(currentProject, onDone); }); }, true); - } else if (ScratchJr.isEditable() && editmode != 'storyStarter' && currentProject && !Project.error && changed) { + } else if (ScratchJr.isEditable() + && editmode != 'storyStarter' + && currentProject + && !Project.error + && changed + ) { Project.prepareToSave(currentProject, onDone); } else { if (onDone) {