Revert "chore: disable caches"
This reverts commit 1f0f45e3f95ed2b44dbd03b2dae848e94b93412d.
This commit is contained in:
parent
68790a4fbb
commit
fb600afabc
@ -22,7 +22,7 @@ export default function useLoginFeed() {
|
||||
const { publisher, system } = useEventPublisher();
|
||||
|
||||
useEffect(() => {
|
||||
//system.checkSigs = checkSigs;
|
||||
system.checkSigs = checkSigs;
|
||||
}, [system, checkSigs]);
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -2,16 +2,17 @@ import "./index.css";
|
||||
import "@szhsin/react-menu/dist/index.css";
|
||||
import "@/assets/fonts/inter.css";
|
||||
|
||||
import { unixNowMs } from "@snort/shared";
|
||||
import { unixNow, unixNowMs } from "@snort/shared";
|
||||
import { EventBuilder } from "@snort/system";
|
||||
import { SnortContext } from "@snort/system-react";
|
||||
import { StrictMode } from "react";
|
||||
import * as ReactDOM from "react-dom/client";
|
||||
import { createBrowserRouter, RouteObject, RouterProvider } from "react-router-dom";
|
||||
|
||||
import { preload, UserCache } from "@/Cache";
|
||||
import { initRelayWorker, preload, Relay, UserCache } from "@/Cache";
|
||||
import { ThreadRoute } from "@/Components/Event/Thread/ThreadRoute";
|
||||
import { IntlProvider } from "@/Components/IntlProvider/IntlProvider";
|
||||
import { db } from "@/Db";
|
||||
import { addCachedMetadataToFuzzySearch } from "@/Db/FuzzySearch";
|
||||
import { AboutPage } from "@/Pages/About";
|
||||
import { DebugPage } from "@/Pages/CacheDebug";
|
||||
@ -39,6 +40,7 @@ import { WalletSendPage } from "@/Pages/wallet/send";
|
||||
import ZapPoolPage from "@/Pages/ZapPool/ZapPool";
|
||||
import { System } from "@/system";
|
||||
import { storeRefCode, unwrap } from "@/Utils";
|
||||
import { hasWasm, wasmInit, WasmPath } from "@/Utils/wasm";
|
||||
import { Wallets } from "@/Wallet";
|
||||
import { setupWebLNWalletConfig } from "@/Wallet";
|
||||
|
||||
@ -51,10 +53,14 @@ async function initSite() {
|
||||
"31990:84de35e2584d2b144aae823c9ed0b0f3deda09648530b93d1a2a146d1dea9864:app-profile",
|
||||
];
|
||||
storeRefCode();
|
||||
if (hasWasm) {
|
||||
await wasmInit(WasmPath);
|
||||
await initRelayWorker();
|
||||
}
|
||||
|
||||
setupWebLNWalletConfig(Wallets);
|
||||
|
||||
//db.ready = await db.isAvailable();
|
||||
db.ready = await db.isAvailable();
|
||||
|
||||
const login = LoginStore.snapshot();
|
||||
preload(login.state.follows).then(async () => {
|
||||
@ -77,7 +83,7 @@ async function initSite() {
|
||||
});
|
||||
|
||||
// cleanup
|
||||
//Relay.delete(["REQ", "cleanup", { kinds: [1, 7, 9735], until: unixNow() - Day * 30 }]);
|
||||
Relay.delete(["REQ", "cleanup", { kinds: [1, 7, 9735], until: unixNow() - Day * 30 }]);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -1,24 +1,25 @@
|
||||
import { removeUndefined, throwIfOffline } from "@snort/shared";
|
||||
import { mapEventToProfile, NostrEvent, NostrSystem } from "@snort/system";
|
||||
|
||||
import { EventsCache, Relay, RelayMetrics, SystemDb, UserCache, UserFollows, UserRelays } from "@/Cache";
|
||||
import { addEventToFuzzySearch } from "@/Db/FuzzySearch";
|
||||
import { LoginStore } from "@/Utils/Login";
|
||||
import { hasWasm, WasmOptimizer } from "@/Utils/wasm";
|
||||
|
||||
/**
|
||||
* Singleton nostr system
|
||||
*/
|
||||
export const System = new NostrSystem({
|
||||
//relays: UserRelays,
|
||||
//events: EventsCache,
|
||||
//profiles: UserCache,
|
||||
//relayMetrics: RelayMetrics,
|
||||
//cachingRelay: Relay,
|
||||
//contactLists: UserFollows,
|
||||
//optimizer: hasWasm ? WasmOptimizer : undefined,
|
||||
//db: SystemDb,
|
||||
relays: UserRelays,
|
||||
events: EventsCache,
|
||||
profiles: UserCache,
|
||||
relayMetrics: RelayMetrics,
|
||||
cachingRelay: Relay,
|
||||
contactLists: UserFollows,
|
||||
optimizer: hasWasm ? WasmOptimizer : undefined,
|
||||
db: SystemDb,
|
||||
buildFollowGraph: true,
|
||||
automaticOutboxModel: true,
|
||||
checkSigs: false,
|
||||
});
|
||||
|
||||
System.on("auth", async (c, r, cb) => {
|
||||
@ -30,8 +31,8 @@ System.on("auth", async (c, r, cb) => {
|
||||
});
|
||||
|
||||
System.on("event", (_, ev) => {
|
||||
//EventsCache.discover(ev);
|
||||
//UserCache.discover(ev);
|
||||
EventsCache.discover(ev);
|
||||
UserCache.discover(ev);
|
||||
addEventToFuzzySearch(ev);
|
||||
});
|
||||
|
||||
|
@ -1,13 +1,5 @@
|
||||
import { debugLog, setLogging } from "./debug";
|
||||
import {
|
||||
EventMetadata,
|
||||
NostrEvent,
|
||||
OkResponse,
|
||||
ReqCommand,
|
||||
WorkerMessage,
|
||||
WorkerMessageCommand,
|
||||
unixNowMs,
|
||||
} from "./types";
|
||||
import { EventMetadata, NostrEvent, OkResponse, ReqCommand, WorkerMessage, WorkerMessageCommand, unixNowMs } from "./types";
|
||||
import { v4 as uuid } from "uuid";
|
||||
|
||||
export interface InitAargs {
|
||||
|
@ -5,4 +5,4 @@ snort:
|
||||
artifacts:
|
||||
- snort-arm64-v8a-v%v.apk
|
||||
- snort-armeabi-v7a-v%v.apk
|
||||
- snort-x86_64-v%v.apk
|
||||
- snort-x86_64-v%v.apk
|
Loading…
x
Reference in New Issue
Block a user