diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-02-17 21:38:42 +0100 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-02-17 21:38:42 +0100 |
| commit | e6a50d2f7f638a2806a7ab43784f68b06df64151 (patch) | |
| tree | e830608b317b0cce371f39ff9f7f7c70ea46a08c /src | |
| parent | ecb02e0bfce0f6341c01bfd907f899389bf34aa5 (diff) | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/Storage/IndexedDB.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Storage/IndexedDB.hs b/src/Storage/IndexedDB.hs index bf986e1..2fa8a97 100644 --- a/src/Storage/IndexedDB.hs +++ b/src/Storage/IndexedDB.hs @@ -188,11 +188,11 @@ foreign import javascript unsafe foreign import javascript unsafe - "const tr = $1.transaction($2, \"readwrite\"); tr.onerror = (event) => { console.log(\"put transaction error\"); }; const key = new Uint8Array(globalThis.wasi_memory.buffer, $3, $4); const value = new Uint8Array(globalThis.wasi_memory.buffer, $5, $6); tr.objectStore($2).put(value, key); tr.commit();" + "const tr = $1.transaction($2, \"readwrite\"); tr.onerror = (event) => { console.log(\"put transaction error\"); }; const key = new Uint8Array(globalThis.wasi_memory.buffer).slice($3, $3 + $4); const value = new Uint8Array(globalThis.wasi_memory.buffer).slice($5, $5 + $6); tr.objectStore($2).put(value, key); tr.commit();" js_db_put :: JSVal -> JSString -> Ptr Word8 -> Int -> Ptr Word8 -> Int -> IO () foreign import javascript unsafe - "const tr = $1.transaction($2, \"readonly\"); tr.onerror = (event) => { console.log(\"get transaction error\"); }; const req = tr.objectStore($2).get(new Uint8Array(globalThis.wasi_memory.buffer, $3, $4)); req.onsuccess = $5; tr.commit();" + "const tr = $1.transaction($2, \"readonly\"); tr.onerror = (event) => { console.log(\"get transaction error\"); }; const req = tr.objectStore($2).get(new Uint8Array(globalThis.wasi_memory.buffer).slice($3, $3 + $4)); req.onsuccess = $5; tr.commit();" js_db_get :: JSVal -> JSString -> Ptr Word8 -> Int -> JSVal -> IO () foreign import javascript unsafe |