[Fix] Fixed webapps for missing userConfig

This commit is contained in:
Robert von Burg 2020-05-12 11:50:18 +02:00
parent 2e2a897e63
commit 3a60e720d8
1 changed files with 14 additions and 5 deletions

View File

@ -271,13 +271,11 @@
}, },
authTokenValid: { authTokenValid: {
type: Boolean, type: Boolean,
value: false value: false,
observer: "authTokenValidObserver"
}, },
userConfig: { userConfig: {
type: Object, type: Object
value: function () {
return Strolch.getUserConfig();
}
}, },
userLocale: { userLocale: {
type: String, type: String,
@ -317,6 +315,7 @@
observers: [], observers: [],
listeners: { listeners: {
"cx-reload": "reload",
"cx-show-toast": "onShowToast", "cx-show-toast": "onShowToast",
"cx-server-not-available": "onServerNotAvailable", "cx-server-not-available": "onServerNotAvailable",
"cx-session-invalid": "onSessionInvalid", "cx-session-invalid": "onSessionInvalid",
@ -331,6 +330,10 @@
"cx-log-out": "onLogOut", "cx-log-out": "onLogOut",
}, },
reload: function () {
this.reloadPage(this.selectedPage);
},
observePage: function (newValue, oldValue) { observePage: function (newValue, oldValue) {
if (newValue) { if (newValue) {
this.reloadPage(newValue); this.reloadPage(newValue);
@ -360,6 +363,12 @@
} }
}, },
authTokenValidObserver: function (newValue, oldValue) {
if (newValue && !oldValue) {
this.userConfig = Strolch.getUserConfig();
}
},
refreshBrowser: function () { refreshBrowser: function () {
localStorage['appScmRevision'] = this.scmRevision; localStorage['appScmRevision'] = this.scmRevision;
document.location.reload(); document.location.reload();