mirror of
https://github.com/imputnet/cobalt.git
synced 2026-02-16 21:46:00 +00:00
web: use AbstractStorage everywhere
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user