1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-30 18:20:15 +02:00

script: prevent remote saving on unloadbefore

This commit is contained in:
Kushagra Gour
2018-01-13 09:58:50 +05:30
parent d6546d35e7
commit 9f2ead1f69

View File

@@ -423,6 +423,12 @@ loginModal
utils.log('saving key', 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(() => {
alertsService.add('Item saved.');
unsavedEditCount = 0;