Skip to content

Commit

Permalink
don't use trusted web instance for iOS
Browse files Browse the repository at this point in the history
as it only intercepts the default app.element.io
  • Loading branch information
bwindels committed Feb 5, 2021
1 parent 163f405 commit 260d2b6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/open/clients/Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down

0 comments on commit 260d2b6

Please sign in to comment.