Activate cached themes on desktop set of application path

This commit is contained in:
Mo Bitar
2019-10-28 12:29:16 -05:00
parent b3ce96dd20
commit 6b9f630737
5 changed files with 22 additions and 14 deletions

View File

@@ -154,6 +154,7 @@ class DesktopManager {
/* Used to resolve "sn://" */
desktop_setApplicationDataPath(path) {
this.applicationDataPath = path;
this.$rootScope.$broadcast("desktop-did-set-application-path");
}
desktop_setComponentInstallationSyncHandler(handler) {

View File

@@ -1,6 +1,6 @@
class ThemeManager {
constructor(componentManager, desktopManager, storageManager, passcodeManager) {
constructor(componentManager, desktopManager, storageManager, passcodeManager, $rootScope) {
this.componentManager = componentManager;
this.storageManager = storageManager;
this.desktopManager = desktopManager;
@@ -17,11 +17,13 @@ class ThemeManager {
this.cacheThemes();
})
// The desktop application won't have its applicationDataPath until the angular document is ready,
// so it wont be able to resolve local theme urls until thats ready
angular.element(document).ready(() => {
if(desktopManager.isDesktop) {
$rootScope.$on("desktop-did-set-application-path", () => {
this.activateCachedThemes();
})
} else {
this.activateCachedThemes();
});
}
}
activateCachedThemes() {