use @ import alias
All checks were successful
Build static content / build (push) Successful in 10m51s

This commit is contained in:
2024-10-14 18:09:07 +08:00
parent 1c3c94bae4
commit f0f040c42c
25 changed files with 209 additions and 180 deletions

View File

@@ -1,7 +1,8 @@
import { IDBPDatabase } from "idb";
import { ChatStore } from "./app";
import { StateUpdater, useRef, useState, Dispatch } from "preact/hooks";
import { ChatStore } from "@/app";
interface ChatStoreSearchResult {
key: IDBValidKey;
cs: ChatStore;
@@ -77,7 +78,7 @@ export default function Search(props: {
}
const now = Math.floor(
(result.length / resultKeys.length) * 100
(result.length / resultKeys.length) * 100,
);
if (now !== searchingNow) setSearchingNow(now);
@@ -89,7 +90,7 @@ export default function Search(props: {
const beginIndex: number = content.indexOf(query);
const preview = content.slice(
Math.max(0, beginIndex - 100),
Math.min(content.length, beginIndex + 239)
Math.min(content.length, beginIndex + 239),
);
result.push({
key,