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