Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit f5ac1e2f authored by Danny Lin's avatar Danny Lin
Browse files

demo: download: Remove dependency on lib/common.js

The dependency on lib/common.js is a relic from when BlobStore was part
of the fastboot.js library. We can't import it directly anymore now that
it has been migrated to TypeScript. It doesn't make much sense to use
the library's internal logging facility here anyway, so remove the
dependency and use console.log directly.
parent 1f228c6b
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
import * as common from "../lib/common.js";

const DB_NAME = "BlobStore";
const DB_VERSION = 1;

@@ -71,14 +69,14 @@ export class BlobStore {
        let filename = url.split("/").pop();
        let blob = await this.loadFile(filename);
        if (blob === null) {
            common.logDebug(`Downloading ${url}`);
            console.log(`Downloading ${url}`);
            let resp = await fetch(new Request(url));
            blob = await resp.blob();
            common.logDebug("File downloaded, saving...");
            console.log("File downloaded, saving...");
            await this.saveFile(filename, blob);
            common.logDebug("File saved");
            console.log("File saved");
        } else {
            common.logDebug(
            console.log(
                `Loaded ${filename} from blob store, skipping download`
            );
        }