feat: automated outbox model
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { createContext } from "react";
|
||||
import { NostrSystem, SystemInterface } from "@snort/system";
|
||||
|
||||
export const SnortContext = createContext<SystemInterface>(new NostrSystem({}));
|
||||
export const SnortContext = createContext<SystemInterface>({} as SystemInterface);
|
||||
|
@ -10,13 +10,13 @@ export function useUserProfile(pubKey?: HexKey): MetadataCache | undefined {
|
||||
return useSyncExternalStore<MetadataCache | undefined>(
|
||||
h => {
|
||||
if (pubKey) {
|
||||
system.ProfileLoader.TrackMetadata(pubKey);
|
||||
system.ProfileLoader.TrackKeys(pubKey);
|
||||
}
|
||||
const release = system.ProfileLoader.Cache.hook(h, pubKey);
|
||||
return () => {
|
||||
release();
|
||||
if (pubKey) {
|
||||
system.ProfileLoader.UntrackMetadata(pubKey);
|
||||
system.ProfileLoader.UntrackKeys(pubKey);
|
||||
}
|
||||
};
|
||||
},
|
||||
|
Reference in New Issue
Block a user