From 1316e307c1ec85a2e91cd614941b17dd93bef754 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 4 Jul 2017 13:06:46 +0200 Subject: [PATCH] Load assets from the storage only if the array is not empty --- index.html | 4 +--- src/asset_manager/index.js | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 08b4c5774..5a5462381 100755 --- a/index.html +++ b/index.html @@ -832,7 +832,7 @@ clearOnRender: 0, storageManager:{ - autoload: 0, + autoload: 1, storeComponents: 1, storeStyles: 1, }, @@ -1292,7 +1292,6 @@ }, }); - /* // Store and load events editor.on('storage:load', function(e) { console.log('LOAD ', e); @@ -1300,7 +1299,6 @@ editor.on('storage:store', function(e) { console.log('STORE ', e); }) - */ editor.render(); diff --git a/src/asset_manager/index.js b/src/asset_manager/index.js index d02df0e38..04903521a 100644 --- a/src/asset_manager/index.js +++ b/src/asset_manager/index.js @@ -185,7 +185,10 @@ module.exports = () => { assets = JSON.parse(d[name]); }catch(err){} - this.getAll().reset(assets); + if (assets && assets.length) { + this.getAll().reset(assets); + } + return assets; },