mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-09 17:39:35 +00:00
fix fts prefix ~
This commit is contained in:
1 parent
f0cafa450d
commit
79deaf9372
3 files changed
+7
-9
No files matched your search
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "cjdic2",
|
||||
"private": true,
|
||||
"version": "0.1.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev:desktop": "cross-env RUST_BACKTRACE=1 tauri dev",
|
||||
|
||||
@@ -153,9 +153,12 @@ function SearchPage() {
|
||||
});
|
||||
|
||||
if (isNew) {
|
||||
if (!result.length && !isFromSplit && /^[^ ]{3,} $/.test(q)) {
|
||||
const [s1, prefix = "", s2 = ""] = q.split(/^([\*\?\[\]\~]*)/);
|
||||
const text = s1 || s2;
|
||||
|
||||
if (!result.length && !isFromSplit && /^[^ ]{3,} $/.test(text)) {
|
||||
const segs = await invoke<{ surface: string }[]>("tokenize", {
|
||||
text: q,
|
||||
text,
|
||||
});
|
||||
if (segs.length > 1) {
|
||||
const newQ =
|
||||
@@ -164,7 +167,7 @@ function SearchPage() {
|
||||
segs.map((s) => s.surface).join("") +
|
||||
" ";
|
||||
|
||||
searchParams_setQ(newQ);
|
||||
searchParams_setQ(prefix + newQ);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -199,10 +202,6 @@ function SearchPage() {
|
||||
set_isScrollEnd(true);
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
target.scrollTop = scrollTop + 100;
|
||||
}, 100);
|
||||
};
|
||||
|
||||
function onSearchboxChange(q: string) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "cjdic2",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"identifier": "cc.polv.cjdic2",
|
||||
"build": {
|
||||
"beforeDevCommand": "pnpm dev",
|
||||
|
||||
Reference in new issue
Block a user