Add a legal disclaimer view

This commit is contained in:
Danila Fedorin
2021-08-25 14:47:42 -07:00
parent c25a9dae4d
commit 34b30de288
3 changed files with 34 additions and 0 deletions
+13
View File
@@ -29,6 +29,7 @@ export class RootViewModel extends ViewModel {
this.openLinkViewModel = null;
this.createLinkViewModel = null;
this.loadServerPolicyViewModel = null;
this.showDisclaimer = false;
this.preferences.on("canClear", () => {
this.emitChange();
});
@@ -50,11 +51,23 @@ export class RootViewModel extends ViewModel {
this.emitChange();
}
_showDisclaimer() {
this.showDisclaimer = true;
this.link = null;
this.openLinkViewModel = null;
this.createLinkViewModel = null;
this.loadServerPolicyViewModel = null;
this.emitChange();
}
updateHash(hash) {
this.showDisclaimer = false;
if (hash.startsWith("#/policy/")) {
const server = hash.substr(9);
this.loadServerPolicyViewModel = new LoadServerPolicyViewModel(this.childOptions({server}));
this.loadServerPolicyViewModel.load();
} else if (hash.startsWith("#/disclaimer/")) {
this._showDisclaimer();
} else {
const oldLink = this.link;
this.link = Link.parse(hash);