From 3f12454b21075817b7cfd0705490ebbdb6c33b37 Mon Sep 17 00:00:00 2001 From: Dylan <36567925+Airyzz@users.noreply.github.com> Date: Sun, 4 Sep 2022 12:16:14 +0930 Subject: [PATCH] Fix Tauri call + Matrix.to handler --- src/util/linkHandlers.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/linkHandlers.jsx b/src/util/linkHandlers.jsx index aaea3b6f..7de4e06d 100644 --- a/src/util/linkHandlers.jsx +++ b/src/util/linkHandlers.jsx @@ -11,7 +11,9 @@ function handleMatrix(url) { let joinedRoom; rooms.forEach((room) => { - if (room.getCanonicalAlias() === roomName || roomName in room.getAltAliases()) { + if (room.roomId === roomName + || room.getCanonicalAlias() === roomName + || roomName in room.getAltAliases()) { joinedRoom = room; } }); @@ -43,11 +45,9 @@ export default function handleLink(e) { // if running inside tauri, check if the tauri backend has a custom handler for this link // useful so we can open urls in a specified app if (window.__TAURI__) { - invoke('open_link', { url: e.target.href }) - .then(() => e.preventDefault()) - .catch((error) => console.error(error)); + e.preventDefault(); + invoke('open_link', { url: e.target.href, bypassHandlers: false }); } else { - // open in new tab window.open(e.target.href); e.preventDefault(); }