mirror of
https://github.com/chinchang/web-maker.git
synced 2025-08-02 11:30:22 +02:00
script: prevent remote saving on unloadbefore
This commit is contained in:
@@ -423,6 +423,12 @@ loginModal
|
|||||||
|
|
||||||
utils.log('saving key', key || currentItem.id, currentItem);
|
utils.log('saving key', key || currentItem.id, currentItem);
|
||||||
saveSetting(key || currentItem.id, currentItem);
|
saveSetting(key || currentItem.id, currentItem);
|
||||||
|
// If key is `code`, this is a call on unloadbefore to save the last open thing.
|
||||||
|
// Do not presist that on remote.
|
||||||
|
if (key === 'code') {
|
||||||
|
// No deferred required here as this gets called on unloadbefore
|
||||||
|
return;
|
||||||
|
}
|
||||||
return itemService.setItem(key || currentItem.id, currentItem).then(() => {
|
return itemService.setItem(key || currentItem.id, currentItem).then(() => {
|
||||||
alertsService.add('Item saved.');
|
alertsService.add('Item saved.');
|
||||||
unsavedEditCount = 0;
|
unsavedEditCount = 0;
|
||||||
|
Reference in New Issue
Block a user