Cached themes updates

This commit is contained in:
Mo Bitar
2018-12-17 17:57:08 -06:00
parent 2f20e92af1
commit d3f97e7bae

View File

@@ -1,6 +1,6 @@
class ThemeManager {
constructor(componentManager, desktopManager, storageManager) {
constructor(componentManager, desktopManager, storageManager, passcodeManager) {
this.componentManager = componentManager;
this.storageManager = storageManager;
this.desktopManager = desktopManager;
@@ -9,7 +9,19 @@ class ThemeManager {
ThemeManager.CachedThemesKey = "cachedThemes";
this.registerObservers();
this.activateCachedThemes();
// When a passcode is added, all local storage will be encrypted (it doesn't know what was
// originally saved as Fixed or FixedEncrypted). We want to rewrite cached themes here to Fixed
// so that it's readable without authentication.
passcodeManager.addPasscodeChangeObserver(() => {
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(() => {
this.activateCachedThemes();
});
}
activateCachedThemes() {