Footer don't keep room state

This commit is contained in:
Mo Bitar
2018-07-05 21:10:30 -05:00
parent 0a85469b2f
commit 7b1a868676
3 changed files with 10 additions and 10 deletions

View File

@@ -136,8 +136,7 @@ angular.module('app')
this.rooms = [];
modelManager.addItemSyncObserver("room-bar", "SN|Component", (allItems, validItems, deletedItems, source) => {
var incomingRooms = allItems.filter((candidate) => {return candidate.area == "rooms"});
this.rooms = _.uniq(this.rooms.concat(incomingRooms)).filter((candidate) => {return !candidate.deleted});
this.rooms = modelManager.components.filter((candidate) => {return candidate.area == "rooms" && !candidate.deleted});
});
componentManager.registerHandler({identifier: "roomBar", areas: ["rooms", "modal"], activationHandler: (component) => {

View File

@@ -14,7 +14,7 @@ class ActionsManager {
}
get extensions() {
return this.modelManager.extensions;
return this.modelManager.validItemsForContentType("Extension");
}
extensionsInContextOfItem(item) {

View File

@@ -18,7 +18,7 @@ class ModelManager extends SFModelManager {
super();
this.notes = [];
this.tags = [];
this._extensions = [];
this.components = [];
this.storageManager = storageManager;
}
@@ -27,7 +27,7 @@ class ModelManager extends SFModelManager {
super.resetLocalMemory();
this.notes.length = 0;
this.tags.length = 0;
this._extensions.length = 0;
this.components.length = 0;
}
findOrCreateTagByTitle(title) {
@@ -58,9 +58,9 @@ class ModelManager extends SFModelManager {
if(!_.find(this.notes, {uuid: item.uuid})) {
this.notes.unshift(item);
}
} else if(item.content_type == "Extension") {
if(!_.find(this._extensions, {uuid: item.uuid})) {
this._extensions.unshift(item);
} else if(item.content_type == "SN|Component") {
if(!_.find(this.components, {uuid: item.uuid})) {
this.components.unshift(item);
}
}
}
@@ -100,8 +100,8 @@ class ModelManager extends SFModelManager {
_.remove(this.tags, {uuid: item.uuid});
} else if(item.content_type == "Note") {
_.remove(this.notes, {uuid: item.uuid});
} else if(item.content_type == "Extension") {
_.remove(this._extensions, {uuid: item.uuid});
} else if(item.content_type == "SN|Component") {
_.remove(this.components, {uuid: item.uuid});
}
}
@@ -118,6 +118,7 @@ class ModelManager extends SFModelManager {
return {
"Note" : "note",
"Tag" : "tag",
"SN|SmartTag": "smart tag",
"Extension" : "action-based extension",
"SN|Component" : "component",
"SN|Editor" : "editor",