Skip to content

Commit

Permalink
fix zip 404 hangs
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Dec 24, 2024
1 parent 542846c commit c895323
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/rime.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
export async function loadZip(url) {
const [_, schema] = await Promise.all([
fcitxReady,
fetch(url).then(res => res.arrayBuffer())
fetch(url).then(res => {
if (!res.ok) {
throw new Error(`Get ${url} error`);
}
return res.arrayBuffer()
})
])
window.fcitx.unzip(schema, '/usr/share/rime-data')
window.fcitx.enable()
Expand Down

0 comments on commit c895323

Please sign in to comment.