Track hidden status in OpenLinkViewModel
This commit is contained in:
parent
b17ce2ee13
commit
b239f49580
1 changed files with 14 additions and 0 deletions
|
@ -32,6 +32,8 @@ export class OpenLinkViewModel extends ViewModel {
|
|||
this.previewViewModel = null;
|
||||
this.clientsViewModel = null;
|
||||
this.previewLoading = false;
|
||||
this.tryingLink = false;
|
||||
this._tryLink();
|
||||
if (this.preferences.homeservers === null) {
|
||||
this._showServerConsent();
|
||||
} else {
|
||||
|
@ -39,6 +41,18 @@ export class OpenLinkViewModel extends ViewModel {
|
|||
}
|
||||
}
|
||||
|
||||
_tryLink() {
|
||||
const matrixUrl = this._link.toMatrixUrl()
|
||||
if (matrixUrl) {
|
||||
this.tryingLink = true;
|
||||
setTimeout(() => {
|
||||
this.tryingLink = false;
|
||||
this.emitChange();
|
||||
}, 5000);
|
||||
this.openLink(matrixUrl);
|
||||
}
|
||||
}
|
||||
|
||||
_showServerConsent() {
|
||||
let servers = [];
|
||||
if (this.preferences.homeservers) {
|
||||
|
|
Loading…
Reference in a new issue