fix: build
This commit is contained in:
@ -100,7 +100,7 @@ export async function subscribeToNotifications(publisher: EventPublisher) {
|
||||
endpoint: sub.endpoint,
|
||||
p256dh: base64.encode(new Uint8Array(unwrap(sub.getKey("p256dh")))),
|
||||
auth: base64.encode(new Uint8Array(unwrap(sub.getKey("auth")))),
|
||||
scope: `${location.protocol}//${location.hostname}`,
|
||||
scope: `${globalThis.location.protocol}//${globalThis.location.hostname}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -134,12 +134,12 @@ class ZapPool extends ExternalStore<Array<ZapPoolRecipient>> {
|
||||
}
|
||||
|
||||
#save() {
|
||||
self.localStorage.setItem("zap-pool", JSON.stringify(this.takeSnapshot()));
|
||||
self.localStorage.setItem("zap-pool-last-payout", this.#lastPayout.toString());
|
||||
globalThis.localStorage.setItem("zap-pool", JSON.stringify(this.takeSnapshot()));
|
||||
globalThis.localStorage.setItem("zap-pool-last-payout", this.#lastPayout.toString());
|
||||
}
|
||||
|
||||
#load() {
|
||||
const existing = self.localStorage.getItem("zap-pool");
|
||||
const existing = globalThis.localStorage.getItem("zap-pool");
|
||||
if (existing) {
|
||||
const arr = JSON.parse(existing) as Array<ZapPoolRecipient>;
|
||||
this.#store = new Map(arr.map(a => [`${a.pubkey}-${a.type}`, a]));
|
||||
@ -157,7 +157,7 @@ class ZapPool extends ExternalStore<Array<ZapPoolRecipient>> {
|
||||
]);
|
||||
}
|
||||
|
||||
const lastPayout = self.localStorage.getItem("zap-pool-last-payout");
|
||||
const lastPayout = globalThis.localStorage.getItem("zap-pool-last-payout");
|
||||
if (lastPayout) {
|
||||
this.#lastPayout = Number(lastPayout);
|
||||
}
|
||||
|
Reference in New Issue
Block a user