fix more warnings, store transformed text in LRUCache of 1000

This commit is contained in:
Martti Malmi
2024-01-10 19:54:01 +02:00
parent 8e37e0fbed
commit e6a42db658
18 changed files with 203 additions and 182 deletions

View File

@ -1,23 +1,10 @@
import { ExternalStore, unwrap } from "@snort/shared";
import { EventKind, parseNostrLink } from "@snort/system";
import { useEffect, useSyncExternalStore } from "react";
import {unwrap} from "@snort/shared";
import {EventKind, parseNostrLink} from "@snort/system";
import {useEffect, useSyncExternalStore} from "react";
import { useLinkList } from "./useLists";
import {LeadersStore} from "@/Cache/CommunityLeadersStore";
class CommunityLeadersStore extends ExternalStore<Array<string>> {
#leaders: Array<string> = [];
setLeaders(arr: Array<string>) {
this.#leaders = arr;
this.notifyChange();
}
takeSnapshot(): string[] {
return [...this.#leaders];
}
}
const LeadersStore = new CommunityLeadersStore();
import {useLinkList} from "./useLists";
export function useCommunityLeaders() {
const link = parseNostrLink(unwrap(CONFIG.communityLeaders).list);