mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 23:10:02 -04:00
percs i swear to god
This commit is contained in:
parent
30c95934ed
commit
b180272b17
4 changed files with 12 additions and 13 deletions
|
@ -1,4 +1,4 @@
|
|||
import IDBMap from "idb-map-entries";
|
||||
import IDBMap from "@webreflection/idb-map";
|
||||
import { FakeServiceWorker } from "./fakesw";
|
||||
import { swfetch } from "./fetch";
|
||||
import { ScramjetThreadpool } from "./threadpool";
|
||||
|
@ -20,7 +20,6 @@ export class ScramjetServiceWorker {
|
|||
serviceWorkers: FakeServiceWorker[] = [];
|
||||
|
||||
constructor() {
|
||||
this.loadConfig();
|
||||
this.client = new self.$scramjet.shared.util.BareClient();
|
||||
|
||||
this.threadpool = new ScramjetThreadpool();
|
||||
|
@ -46,17 +45,18 @@ export class ScramjetServiceWorker {
|
|||
});
|
||||
}
|
||||
|
||||
loadConfig() {
|
||||
async loadConfig() {
|
||||
if (this.config) return;
|
||||
|
||||
const store = new IDBMap("config", {
|
||||
prefix: "scramjet",
|
||||
});
|
||||
|
||||
if (store.has("config")) {
|
||||
store.get("config").then((config) => {
|
||||
this.config = config;
|
||||
self.$scramjet.config = config;
|
||||
self.$scramjet.codec = self.$scramjet.codecs[config.codec];
|
||||
});
|
||||
const config = await store.get("config");
|
||||
this.config = config;
|
||||
self.$scramjet.config = config;
|
||||
self.$scramjet.codec = self.$scramjet.codecs[config.codec];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue