MetadataCache -> CachedMetadata, addCachedMetadataToFuzzySearch
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
import { useContext, useSyncExternalStore } from "react";
|
||||
import { HexKey, MetadataCache } from "@snort/system";
|
||||
import { HexKey, CachedMetadata } from "@snort/system";
|
||||
import { SnortContext } from "./context";
|
||||
|
||||
/**
|
||||
* Gets a profile from cache or requests it from the relays
|
||||
*/
|
||||
export function useUserProfile(pubKey?: HexKey): MetadataCache | undefined {
|
||||
export function useUserProfile(pubKey?: HexKey): CachedMetadata | undefined {
|
||||
const system = useContext(SnortContext);
|
||||
return useSyncExternalStore<MetadataCache | undefined>(
|
||||
return useSyncExternalStore<CachedMetadata | undefined>(
|
||||
h => {
|
||||
if (pubKey) {
|
||||
system.ProfileLoader.TrackKeys(pubKey);
|
||||
|
Reference in New Issue
Block a user