From 472925bb05e23a63134cf132f8d9b9a960aa6c0e Mon Sep 17 00:00:00 2001
From: Ren Amamiya <123083837+reyamir@users.noreply.github.com>
Date: Thu, 7 Sep 2023 12:19:28 +0700
Subject: [PATCH] small fixes
---
src/shared/navigation.tsx | 7 ++++++-
src/shared/notes/mentions/note.tsx | 27 +++++++++++----------------
src/utils/parser.ts | 6 +++---
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/src/shared/navigation.tsx b/src/shared/navigation.tsx
index c27c29b6..8dd7e886 100644
--- a/src/shared/navigation.tsx
+++ b/src/shared/navigation.tsx
@@ -4,6 +4,8 @@ import { twMerge } from 'tailwind-merge';
import { ChatsList } from '@app/chats/components/list';
+import { useStorage } from '@libs/storage/provider';
+
import { ActiveAccount } from '@shared/accounts/active';
import { ComposerModal } from '@shared/composer';
import { Frame } from '@shared/frame';
@@ -12,11 +14,14 @@ import { BellIcon, NavArrowDownIcon, SpaceIcon } from '@shared/icons';
import { useSidebar } from '@stores/sidebar';
export function Navigation() {
+ const { db } = useStorage();
const [chats, toggleChats] = useSidebar((state) => [state.chats, state.toggleChats]);
return (
-
+ {db.platform === 'darwin' ? (
+
+ ) : null}
diff --git a/src/shared/notes/mentions/note.tsx b/src/shared/notes/mentions/note.tsx
index b6a9eb95..a663db79 100644
--- a/src/shared/notes/mentions/note.tsx
+++ b/src/shared/notes/mentions/note.tsx
@@ -58,29 +58,24 @@ export const MentionNote = memo(function MentionNote({ id }: { id: string }) {
if (status === 'error') {
const noteLink = `https://nostr.com/${nip19.noteEncode(id)}`;
return (
-
-
-
+
+
-
-
-
-
-
- Lume cannot find this post with your current relays, but you can view it
- via nostr.com.{' '}
-
- Learn more
-
-
-
-
+
+
+ Lume cannot find this post with your current relays, but you can view it via
+ nostr.com.{' '}
+
+ Learn more
+
+
);
diff --git a/src/utils/parser.ts b/src/utils/parser.ts
index aa7b39bb..3e450c91 100644
--- a/src/utils/parser.ts
+++ b/src/utils/parser.ts
@@ -32,18 +32,18 @@ export function parser(eventContent: string) {
const url = new URL(word);
url.search = '';
- if (url.toString().match(/\.(jpg|jpeg|gif|png|webp|avif)$/)) {
+ if (url.pathname.match(/\.(jpg|jpeg|gif|png|webp|avif)$/)) {
// image url
content.images.push(word);
// remove url from original content
return word.replace(word, '');
}
- if (url.toString().match(/\.(mp4|mov|webm|wmv|flv|mts|avi|ogv|mkv|mp3|m3u8)$/)) {
+ if (url.pathname.match(/\.(mp4|mov|webm|wmv|flv|mts|avi|ogv|mkv|mp3|m3u8)$/)) {
// video
content.videos.push(word);
// remove url from original content
- word = word.replace(word, '');
+ return word.replace(word, '');
}
content.links.push(url.toString());