Reload theme dock logic

This commit is contained in:
Mo Bitar
2018-12-20 12:35:31 -06:00
parent 2edeb553cc
commit 9b08f1e124
3 changed files with 9 additions and 7 deletions

View File

@@ -138,20 +138,22 @@ angular.module('app')
this.componentManager = componentManager;
this.rooms = [];
this.themes = [];
this.themesWithIcons = [];
modelManager.addItemSyncObserver("room-bar", "SN|Component", (allItems, validItems, deletedItems, source) => {
this.rooms = modelManager.components.filter((candidate) => {return candidate.area == "rooms" && !candidate.deleted});
});
modelManager.addItemSyncObserver("footer-bar-themes", "SN|Theme", (allItems, validItems, deletedItems, source) => {
let themes = modelManager.validItemsForContentType("SN|Theme").filter((candidate) => {return !candidate.deleted}).sort((a, b) => {
let themes = modelManager.validItemsForContentType("SN|Theme").filter((candidate) => {
return !candidate.deleted && candidate.content.package_info.dock_icon;
}).sort((a, b) => {
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
});
let differ = themes.length != this.themes.length;
let differ = themes.length != this.themesWithIcons.length;
this.themes = themes;
this.themesWithIcons = themes;
if(differ) {
this.reloadDockShortcuts();
@@ -160,7 +162,7 @@ angular.module('app')
this.reloadDockShortcuts = function() {
let shortcuts = [];
for(var theme of this.themes) {
for(var theme of this.themesWithIcons) {
var icon = theme.content.package_info.dock_icon;
if(!icon) {
continue;

View File

@@ -1,6 +1,6 @@
{
"name": "standard-notes-web",
"version": "3.0.0-beta1",
"version": "3.0.0-beta3",
"license": "AGPL-3.0-or-later",
"repository": {
"type": "git",