web: use AbstractStorage everywhere

This commit is contained in:
jj
2025-04-30 18:01:02 +00:00
parent 1ed08e9d23
commit 7b504a4559
2 changed files with 6 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import { OPFSStorage } from "$lib/storage/opfs";
import * as Storage from "$lib/storage";
let attempts = 0;
@@ -37,7 +37,7 @@ const fetchFile = async (url: string) => {
const contentLength = response.headers.get('Content-Length');
const estimatedLength = response.headers.get('Estimated-Content-Length');
let totalBytes = null;
let totalBytes;
if (contentLength) {
totalBytes = +contentLength;
@@ -47,7 +47,7 @@ const fetchFile = async (url: string) => {
const reader = response.body?.getReader();
const storage = await OPFSStorage.init();
const storage = await Storage.init(totalBytes);
if (!reader) {
return error("no reader");