Skip to content

Commit

Permalink
use pinned version for sql and jieba
Browse files Browse the repository at this point in the history
  • Loading branch information
krmanik committed Aug 7, 2024
1 parent 30795ce commit 9e5c1b3
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pages/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import styles from "./index.module.css";
import { MsEdgeTTS, OUTPUT_FORMAT } from "msedge-tts";
import { ProgressBar } from "primereact/progressbar";

let host = "https://krmanik.github.io/Anki-xiehanzi";

export default function CreateDeck(): JSX.Element {
const [words, setWords] = useState<
{
Expand Down Expand Up @@ -290,15 +292,15 @@ export default function CreateDeck(): JSX.Element {
DICT.loadDict();
setupSql();
init(
"https://cdn.jsdelivr.net/npm/jieba-wasm@latest/pkg/web/jieba_rs_wasm_bg.wasm"
`${host}/data/jieba_rs_wasm_bg.wasm`
);
}, []);

const setupSql = async () => {
try {
const SQL = await initSqlJs({
locateFile: (filename) =>
"https://cdn.jsdelivr.net/npm/sql.js/dist/sql-wasm.wasm",
`${host}/data/sql-wasm.wasm`,
});
let db = new SQL.Database();
setDb(db);
Expand Down
Binary file added static/data/jieba_rs_wasm_bg.wasm
Binary file not shown.
Loading

0 comments on commit 9e5c1b3

Please sign in to comment.