From dd5e7e1acb55c40b1817c366f0241f4e09ae2d7b Mon Sep 17 00:00:00 2001 From: codytseng Date: Sun, 26 Jan 2025 22:10:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NoteList/index.tsx | 4 ++-- src/components/SearchDialog/index.tsx | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/NoteList/index.tsx b/src/components/NoteList/index.tsx index 710bcf7..a14d309 100644 --- a/src/components/NoteList/index.tsx +++ b/src/components/NoteList/index.tsx @@ -194,7 +194,7 @@ export default function NoteList({ >
{newEvents.filter(eventFilter).length > 0 && ( -
+
@@ -219,7 +219,7 @@ export default function NoteList({ ) : events.length ? ( t('no more notes') ) : ( -
+
diff --git a/src/components/SearchDialog/index.tsx b/src/components/SearchDialog/index.tsx index c1faba1..d3dbf5f 100644 --- a/src/components/SearchDialog/index.tsx +++ b/src/components/SearchDialog/index.tsx @@ -17,12 +17,15 @@ export function SearchDialog({ open, setOpen }: { open: boolean; setOpen: Dispat const [debouncedInput, setDebouncedInput] = useState(input) const { profiles } = useSearchProfiles(debouncedInput, 10) const normalizedUrl = useMemo(() => { + if (['w', 'ws', 'ws:', 'ws:/', 'wss', 'wss:', 'wss:/'].includes(input)) { + return undefined + } try { - return normalizeUrl(debouncedInput) + return normalizeUrl(input) } catch { return undefined } - }, [debouncedInput]) + }, [input]) const list = useMemo(() => { const search = input.trim() @@ -55,9 +58,9 @@ export function SearchDialog({ open, setOpen }: { open: boolean; setOpen: Dispat return ( <> - {!!normalizedUrl && setOpen(false)} />} setOpen(false)} /> setOpen(false)} /> + {!!normalizedUrl && setOpen(false)} />} {profiles.map((profile) => ( setOpen(false)} /> ))}