From 7782a9d197267d6571946ff62b3e67ebf8f5cb6f Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 7 Dec 2020 18:24:10 +0100 Subject: [PATCH] also include preference homeservers in server dialog --- src/open/OpenLinkViewModel.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/open/OpenLinkViewModel.js b/src/open/OpenLinkViewModel.js index bd72ff8..ebd6210 100644 --- a/src/open/OpenLinkViewModel.js +++ b/src/open/OpenLinkViewModel.js @@ -20,6 +20,7 @@ import {ClientViewModel} from "./ClientViewModel.js"; import {PreviewViewModel} from "../preview/PreviewViewModel.js"; import {ServerConsentViewModel} from "./ServerConsentViewModel.js"; import {getLabelForLinkKind} from "../Link.js"; +import {orderedUnique} from "../utils/unique.js"; export class OpenLinkViewModel extends ViewModel { constructor(options) { @@ -39,8 +40,14 @@ export class OpenLinkViewModel extends ViewModel { } _showServerConsent() { + let servers = []; + if (this.preferences.homeservers) { + servers.push(...this.preferences.homeservers); + } + servers.push(...this._link.servers); + servers = orderedUnique(servers); this.serverConsentViewModel = new ServerConsentViewModel(this.childOptions({ - servers: this._link.servers, + servers, done: () => { this.serverConsentViewModel = null; this._showLink();