Merge branch 'main' into danilafe/legal-disclaimer
This commit is contained in:
commit
a773daa0cd
1 changed files with 8 additions and 5 deletions
|
@ -51,25 +51,28 @@ export class RootViewModel extends ViewModel {
|
||||||
this.emitChange();
|
this.emitChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
_showDisclaimer() {
|
_hideLinks() {
|
||||||
this.showDisclaimer = true;
|
|
||||||
this.link = null;
|
this.link = null;
|
||||||
this.openLinkViewModel = null;
|
this.openLinkViewModel = null;
|
||||||
this.createLinkViewModel = null;
|
this.createLinkViewModel = null;
|
||||||
this.loadServerPolicyViewModel = null;
|
|
||||||
this.emitChange();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateHash(hash) {
|
updateHash(hash) {
|
||||||
this.showDisclaimer = false;
|
this.showDisclaimer = false;
|
||||||
if (hash.startsWith("#/policy/")) {
|
if (hash.startsWith("#/policy/")) {
|
||||||
const server = hash.substr(9);
|
const server = hash.substr(9);
|
||||||
|
this._hideLinks();
|
||||||
this.loadServerPolicyViewModel = new LoadServerPolicyViewModel(this.childOptions({server}));
|
this.loadServerPolicyViewModel = new LoadServerPolicyViewModel(this.childOptions({server}));
|
||||||
this.loadServerPolicyViewModel.load();
|
this.loadServerPolicyViewModel.load();
|
||||||
|
this.emitChange();
|
||||||
} else if (hash.startsWith("#/disclaimer/")) {
|
} else if (hash.startsWith("#/disclaimer/")) {
|
||||||
this._showDisclaimer();
|
this._hideLinks();
|
||||||
|
this.loadServerPolicyViewModel = null;
|
||||||
|
this.showDisclaimer = true;
|
||||||
|
this.emitChange();
|
||||||
} else {
|
} else {
|
||||||
const oldLink = this.link;
|
const oldLink = this.link;
|
||||||
|
this.loadServerPolicyViewModel = null;
|
||||||
this.link = Link.parse(hash);
|
this.link = Link.parse(hash);
|
||||||
this._updateChildVMs(oldLink);
|
this._updateChildVMs(oldLink);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue