mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2025-02-17 17:01:12 -05:00
don't save project if project not changed
This commit is contained in:
parent
064ee0cf48
commit
cc7b6ee883
2 changed files with 8 additions and 2 deletions
|
@ -83,6 +83,10 @@ export default class ScratchJr {
|
|||
changed = newChanged;
|
||||
}
|
||||
|
||||
static get changed () {
|
||||
return changed;
|
||||
}
|
||||
|
||||
static set storyStarted (newStoryStarted) {
|
||||
storyStarted = newStoryStarted;
|
||||
}
|
||||
|
|
|
@ -336,7 +336,7 @@ export default class UI {
|
|||
|
||||
static handleTextFieldSave (dontHide) {
|
||||
// Handle story-starter mode project
|
||||
if (ScratchJr.isEditable() && ScratchJr.editmode == 'storyStarter' && !Project.error) {
|
||||
if (ScratchJr.isEditable() && ScratchJr.editmode == 'storyStarter' && !Project.error && ScratchJr.changed) {
|
||||
OS.analyticsEvent('samples', 'story_starter_edited', Project.metadata.name);
|
||||
// Get the new project name
|
||||
var sampleName = Localization.localize('SAMPLE_' + Project.metadata.name);
|
||||
|
@ -370,7 +370,6 @@ export default class UI {
|
|||
ScratchJr.storyStart('UI.handleTextFieldSave');
|
||||
}
|
||||
Project.metadata.name = pname;
|
||||
ScratchJr.changed = true;
|
||||
OS.setfield(OS.database, Project.metadata.id, 'name', pname);
|
||||
if (!dontHide) {
|
||||
ScratchAudio.sndFX('exittap.wav');
|
||||
|
@ -389,6 +388,9 @@ export default class UI {
|
|||
return;
|
||||
}
|
||||
|
||||
var canShare = ScratchJr.editmode != 'storyStarter' || ScratchJr.changed;
|
||||
gn('infoboxParentsSectionButton').style.display = canShare ? 'block' : 'none';
|
||||
|
||||
// Prevent button from thrashing
|
||||
setTimeout(function () {
|
||||
okclicky.ontouchend = UI.hideInfoBox;
|
||||
|
|
Loading…
Reference in a new issue