feat: improve performance (#234)

* feat: use negentropy as much as possible

* update

* update
This commit is contained in:
雨宮蓮
2024-09-29 16:53:39 +07:00
committed by GitHub
parent afa9327bb7
commit f0fc89724d
26 changed files with 566 additions and 373 deletions

View File

@@ -54,7 +54,7 @@ export function useEvent(id: string) {
refetchOnMount: false,
refetchOnReconnect: false,
staleTime: Number.POSITIVE_INFINITY,
retry: false,
retry: 2,
});
return { isLoading, isError, error, data };

View File

@@ -38,7 +38,7 @@ export function useProfile(pubkey: string, embed?: string) {
refetchOnWindowFocus: false,
refetchOnReconnect: false,
staleTime: Number.POSITIVE_INFINITY,
retry: false,
retry: 2,
});
return { isLoading, isError, profile };

View File

@@ -58,7 +58,7 @@ export const LumeWindow = {
eTags.find((el) => el[3] === "reply")?.[1] ?? eTags[1]?.[1];
const url = `/columns/events/${root ?? reply ?? event.id}`;
const label = `event-${root ?? reply ?? event.id}`;
const label = `event-${root?.substring(0, 6) ?? reply?.substring(0, 6) ?? event.id.substring(0, 6)}`;
LumeWindow.openColumn({ label, url, name: "Thread" });
},