diff --git a/package.json b/package.json index 0df6806..5f26046 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "@reduxjs/toolkit": "^1.9.1", "bech32": "^2.0.0", "light-bolt11-decoder": "^2.1.0", - "moment": "^2.29.4", "qr-code-styling": "^1.6.0-rc.1", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/src/Text.js b/src/Text.js index 382376b..58a3c15 100644 --- a/src/Text.js +++ b/src/Text.js @@ -2,14 +2,13 @@ import { Link } from "react-router-dom"; import Invoice from "./element/Invoice"; import { UrlRegex, FileExtensionRegex, MentionRegex, InvoiceRegex, YoutubeUrlRegex } from "./Const"; -import { eventLink, profileLink } from "./Util"; +import { eventLink, hexToBech32, profileLink } from "./Util"; function transformHttpLink(a) { try { const url = new URL(a); - const vParam = url.searchParams.get('v') - const youtubeId = YoutubeUrlRegex.test(a) && RegExp.$1 - const extension = FileExtensionRegex.test(url.pathname.toLowerCase()) && RegExp.$1 + const youtubeId = YoutubeUrlRegex.test(a) && RegExp.$1; + const extension = FileExtensionRegex.test(url.pathname.toLowerCase()) && RegExp.$1; if (extension) { switch (extension) { case "gif": @@ -28,7 +27,7 @@ function transformHttpLink(a) { return