From 4a6715be21a6144b8ab962c5b2bfe47a29e79836 Mon Sep 17 00:00:00 2001 From: Kevin Kandlbinder Date: Mon, 12 Sep 2022 02:04:42 +0200 Subject: [PATCH] Fix double slicing --- src/Link.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Link.js b/src/Link.js index 80a4925..d01cb5f 100644 --- a/src/Link.js +++ b/src/Link.js @@ -111,7 +111,6 @@ export class Link { if (!linkStr.startsWith("#/")) { return null; } - linkStr = linkStr.slice(2); const linkStrMatrixUrl = fragment.substr(2).startsWith("matrix:") ? fragment.substr(2) : "matrix:"+fragment.substr(2); @@ -135,7 +134,7 @@ export class Link { return link; } catch(e) {} // The fragment was no matrix-URL. - linkStr = linkStr.substr(2); + linkStr = linkStr.slice(2); const [identifier, eventId] = linkStr.split("/");