don't use trusted web instance for iOS

as it only intercepts the default app.element.io
This commit is contained in:
Bruno Windels 2021-02-05 13:00:26 +01:00
parent 163f405ae5
commit 260d2b61cd
1 changed files with 5 additions and 2 deletions

View File

@ -62,9 +62,12 @@ export class Element {
fragmentPath = `room/${link.identifier}/${link.eventId}`;
break;
}
if (platform === Platform.DesktopWeb || platform === Platform.MobileWeb || platform === Platform.iOS) {
const isWebPlatform = platform === Platform.DesktopWeb || platform === Platform.MobileWeb;
if (isWebPlatform || platform === Platform.iOS) {
let instanceHost = trustedWebInstances[0];
if (trustedWebInstances.includes(link.webInstances[this.id])) {
// we use app.element.io which iOS will intercept, but it likely won't intercept any other trusted instances
// so only use a preferred web instance for true web links.
if (isWebPlatform && trustedWebInstances.includes(link.webInstances[this.id])) {
instanceHost = link.webInstances[this.id];
}
return `https://${instanceHost}/#/${fragmentPath}`;