Commit 96826a5f authored by Chunchi Che's avatar Chunchi Che

fix

parent 423c93c0
Pipeline #19963 passed with stages
in 5 minutes and 44 seconds
......@@ -83,9 +83,10 @@ export default async function (action: sqliteAction): Promise<sqliteResult> {
const ftsMetas: CardMeta[] = [];
const textStmt = YGODB.prepare(
"SELECT * FROM texts WHERE name LIKE '%$query%'"
"SELECT * FROM texts WHERE name LIKE $query"
);
textStmt.bind({ $query: query });
textStmt.bind({ $query: `%${query}%` });
while (textStmt.step()) {
const row = textStmt.getAsObject();
ftsTexts.push(row);
......@@ -93,7 +94,6 @@ export default async function (action: sqliteAction): Promise<sqliteResult> {
for (const text of ftsTexts) {
const id = text.id;
if (id) {
const dataStmt = YGODB.prepare(
"SELECT * FROM datas WHERE ID = $id"
......
......@@ -40,22 +40,26 @@ export default function WaitRoom() {
useEffect(() => {
if (ip && player && player.length != 0 && passWd && passWd.length != 0) {
// 页面第一次渲染时,通过socket中间件向ygopro服务端请求建立长连接
socketMiddleWare({
cmd: socketCmd.CONNECT,
initInfo: {
ip,
player,
passWd,
},
});
}
const init = async () => {
// 页面第一次渲染时,通过socket中间件向ygopro服务端请求建立长连接
socketMiddleWare({
cmd: socketCmd.CONNECT,
initInfo: {
ip,
player,
passWd,
},
});
// 初始化sqlite
await sqliteMiddleWare({
cmd: sqliteCmd.INIT,
initInfo: { dbUrl: "/ygopro-database/locales/zh-CN/cards.cdb" },
});
};
// 初始化sqlite
sqliteMiddleWare({
cmd: sqliteCmd.INIT,
initInfo: { dbUrl: "/ygopro-database/locales/zh-CN/cards.cdb" },
});
init();
}
}, []);
const dispatch = store.dispatch;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment