Clear localStorage before db destroy

This commit is contained in:
Mo Bitar
2017-08-22 17:37:12 -05:00
parent bbc55d5444
commit a9e414d271
2 changed files with 2 additions and 1 deletions

View File

@@ -32,6 +32,7 @@ class ComponentManager {
for(var component of syncedComponents) { for(var component of syncedComponents) {
var activeComponent = _.find(this.activeComponents, {uuid: component.uuid}); var activeComponent = _.find(this.activeComponents, {uuid: component.uuid});
if(component.active && !activeComponent) { if(component.active && !activeComponent) {
console.log("Activating comp", component);
this.activateComponent(component); this.activateComponent(component);
} else if(!component.active && activeComponent) { } else if(!component.active && activeComponent) {
this.deactivateComponent(component); this.deactivateComponent(component);

View File

@@ -325,8 +325,8 @@ class SyncManager {
} }
destroyLocalData(callback) { destroyLocalData(callback) {
localStorage.clear();
this.dbManager.clearAllItems(function(){ this.dbManager.clearAllItems(function(){
localStorage.clear();
if(callback) { if(callback) {
this.$timeout(function(){ this.$timeout(function(){
callback(); callback();