From 4162866fd6502c8632d86ba48b6ced962d9b7094 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Wed, 15 May 2024 18:22:52 +0800 Subject: [PATCH] Add autoFocus to search input and improve code formatting --- src/search.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/search.tsx b/src/search.tsx index 5295105..1e19c2d 100644 --- a/src/search.tsx +++ b/src/search.tsx @@ -44,6 +44,7 @@ export default function Search(props: {
{ @@ -81,7 +82,9 @@ export default function Search(props: { if (now !== searchingNow) setSearchingNow(now); const value: ChatStore = await db.get("chatgpt-api-web", key); - const content = value.contents_for_index.join(" ").toLowerCase(); + const content = value.contents_for_index + .join(" ") + .toLowerCase(); if (content.includes(query)) { const beginIndex: number = content.indexOf(query); const preview = content.slice(