Skip to content

Commit dde8a6d

Browse files
committed
fix: DecompressionStream on Safari
1 parent 1acc796 commit dde8a6d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
},
2727
"dependencies": {
2828
"@preact/signals": "^1.2.2",
29+
"compression-streams-polyfill": "^0.1.7",
2930
"fuse.js": "^7.0.0",
3031
"preact": "^10.19.2",
3132
"preact-custom-element": "^4.3.0",

src/dm-planimetrie/PlanimetrieModel.js

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ const loadModelDM = async () => {
2828

2929
const blob = await res.blob()
3030

31+
if (!window.DecompressionStream) {
32+
await import('compression-streams-polyfill')
33+
}
34+
3135
const ds = new DecompressionStream('gzip')
3236
const decompressedStream = blob.stream().pipeThrough(ds)
3337
const rawText = await streamToText(decompressedStream)

0 commit comments

Comments
 (0)