fix: eslint errors
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Kieran 2023-05-25 11:12:08 +01:00
parent f684658183
commit 9bfb6ede0a
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
11 changed files with 14 additions and 17 deletions

View File

@ -11,8 +11,8 @@ class DMCache extends FeedCache<RawEvent> {
return of.id;
}
override async preload(follows?: Array<string>): Promise<void> {
await super.preload(follows);
override async preload(): Promise<void> {
await super.preload();
// load all dms to memory
await this.buffer([...this.onTable]);
}

View File

@ -12,8 +12,8 @@ class EventInteractionCache extends FeedCache<EventInteraction> {
return sha256(of.event + of.by);
}
override async preload(follows?: Array<string>): Promise<void> {
await super.preload(follows);
override async preload(): Promise<void> {
await super.preload();
const data = window.localStorage.getItem("zap-cache");
if (data) {

View File

@ -35,7 +35,7 @@ export default abstract class FeedCache<TCached> {
}, 30_000);
}
async preload(follows?: Array<string>) {
async preload() {
if (db.ready) {
const keys = await this.table.toCollection().primaryKeys();
this.onTable = new Set<string>(keys.map(a => a as string));

View File

@ -19,7 +19,7 @@ class UserProfileCache extends FeedCache<MetadataCache> {
}
override async preload(follows?: Array<string>): Promise<void> {
await super.preload(follows);
await super.preload();
// load follows profiles
if (follows) {
await this.buffer(follows);

View File

@ -11,7 +11,7 @@ class UsersRelaysCache extends FeedCache<UsersRelays> {
}
override async preload(follows?: Array<string>): Promise<void> {
await super.preload(follows);
await super.preload();
if (follows) {
await this.buffer(follows);
}

View File

@ -55,8 +55,8 @@ export function mapEventToProfile(ev: RawEvent) {
export async function preload(follows?: Array<string>) {
const preloads = [
UserCache.preload(follows),
DmCache.preload(follows),
InteractionCache.preload(follows),
DmCache.preload(),
InteractionCache.preload(),
UserRelays.preload(follows),
];
await Promise.all(preloads);

View File

@ -35,7 +35,6 @@ export default function Relay(props: RelayProps) {
);
}
const latency = Math.floor(state?.avgLatency ?? 0);
return (
<>
<div className={`relay w-max`}>

View File

@ -1,5 +1,4 @@
import { InvoiceRequest, LNWallet, Sats, WalletError, WalletErrorCode, WalletInfo, WalletInvoice } from "Wallet";
import { LNWallet, Sats, WalletError, WalletErrorCode, WalletInfo, WalletInvoice } from "Wallet";
import { CashuMint, CashuWallet as TheCashuWallet, Proof } from "@cashu/cashu-ts";
export class CashuWallet implements LNWallet {

View File

@ -21,13 +21,12 @@ export interface ZapPoolRecipient {
}
class ZapPool extends ExternalStore<Array<ZapPoolRecipient>> {
#store: Map<string, ZapPoolRecipient>;
#store = new Map<string, ZapPoolRecipient>();
#isPayoutInProgress = false;
#lastPayout: number = 0;
#lastPayout = 0;
constructor() {
super();
this.#store = new Map();
this.#load();
setTimeout(() => this.#autoPayout().catch(console.error), 5_000);
}

View File

@ -36,7 +36,7 @@ import { db } from "Db";
import { preload } from "Cache";
import { LoginStore } from "Login";
// @ts-ignore
// @ts-expect-error Setting webpack nonce
window.__webpack_nonce__ = "ZmlhdGphZiBzYWlkIHNub3J0LnNvY2lhbCBpcyBwcmV0dHkgZ29vZCwgd2UgbWFkZSBpdCE=";
serviceWorkerRegistration.register();

View File

@ -1,6 +1,6 @@
/// <reference lib="webworker" />
import {} from ".";
declare var self: ServiceWorkerGlobalScope;
declare const self: ServiceWorkerGlobalScope;
import { clientsClaim } from "workbox-core";
import { ExpirationPlugin } from "workbox-expiration";