From b239f495804dad22c35b3be5b3a5138df576665c Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 24 Aug 2021 12:24:45 -0700 Subject: [PATCH] Track hidden status in OpenLinkViewModel --- src/open/OpenLinkViewModel.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/open/OpenLinkViewModel.js b/src/open/OpenLinkViewModel.js index 2b5d295..2580d38 100644 --- a/src/open/OpenLinkViewModel.js +++ b/src/open/OpenLinkViewModel.js @@ -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) {