Browse Source

Load assets from the storage only if the array is not empty

pull/187/head
Artur Arseniev 9 years ago
parent
commit
1316e307c1
  1. 4
      index.html
  2. 5
      src/asset_manager/index.js

4
index.html

@ -832,7 +832,7 @@
clearOnRender: 0, clearOnRender: 0,
storageManager:{ storageManager:{
autoload: 0, autoload: 1,
storeComponents: 1, storeComponents: 1,
storeStyles: 1, storeStyles: 1,
}, },
@ -1292,7 +1292,6 @@
}, },
}); });
/*
// Store and load events // Store and load events
editor.on('storage:load', function(e) { editor.on('storage:load', function(e) {
console.log('LOAD ', e); console.log('LOAD ', e);
@ -1300,7 +1299,6 @@
editor.on('storage:store', function(e) { editor.on('storage:store', function(e) {
console.log('STORE ', e); console.log('STORE ', e);
}) })
*/
editor.render(); editor.render();
</script> </script>

5
src/asset_manager/index.js

@ -185,7 +185,10 @@ module.exports = () => {
assets = JSON.parse(d[name]); assets = JSON.parse(d[name]);
}catch(err){} }catch(err){}
this.getAll().reset(assets); if (assets && assets.length) {
this.getAll().reset(assets);
}
return assets; return assets;
}, },

Loading…
Cancel
Save