mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-25 00:28:20 -05:00
Merge pull request #55 from LLK/bugfix/autosave-disable
Disable autosave when onHold, Project.saving, or info box open
This commit is contained in:
commit
d928f81821
2 changed files with 9 additions and 2 deletions
|
@ -206,7 +206,7 @@ export default class ScratchJr {
|
|||
Events.init();
|
||||
if (window.Settings.autoSaveInterval > 0) {
|
||||
autoSaveSetInterval = window.setInterval(function () {
|
||||
if (autoSaveEnabled) {
|
||||
if (autoSaveEnabled && !onHold && !Project.saving && !UI.infoBoxOpen) {
|
||||
ScratchJr.saveProject(null, function () {
|
||||
Alert.close();
|
||||
});
|
||||
|
@ -346,7 +346,7 @@ export default class ScratchJr {
|
|||
// Re-enable autosaves
|
||||
autoSaveEnabled = true;
|
||||
autoSaveSetInterval = window.setInterval(function () {
|
||||
if (autoSaveEnabled) {
|
||||
if (autoSaveEnabled && !onHold && !Project.saving && !UI.infoBoxOpen) {
|
||||
ScratchJr.saveProject(null, function () {
|
||||
Alert.close();
|
||||
});
|
||||
|
|
|
@ -26,8 +26,13 @@ import {frame, gn, CSSTransition, localx, newHTML, scaleMultiplier, getIdFor, is
|
|||
let projectNameTextInput = null;
|
||||
let info = null;
|
||||
let okclicky = null;
|
||||
let infoBoxOpen = false;
|
||||
|
||||
export default class UI {
|
||||
static get infoBoxOpen () {
|
||||
return infoBoxOpen;
|
||||
}
|
||||
|
||||
static layout () {
|
||||
UI.topSection();
|
||||
UI.middleSection();
|
||||
|
@ -350,6 +355,7 @@ export default class UI {
|
|||
}
|
||||
|
||||
static showInfoBox (e) {
|
||||
infoBoxOpen = true;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (Paint.saving) {
|
||||
|
@ -432,6 +438,7 @@ export default class UI {
|
|||
ScratchAudio.sndFX('exittap.wav');
|
||||
gn('infobox').className = 'infobox fade';
|
||||
}
|
||||
infoBoxOpen = false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
|
|
Loading…
Reference in a new issue