fix: dont take into account old contact lists
This commit is contained in:
@ -304,4 +304,4 @@ const barierNip07 = async (then: () => Promise<any>) => {
|
||||
} finally {
|
||||
isNip07Busy = false;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -30,6 +30,7 @@ export default function useLoginFeed() {
|
||||
sub.Id = `login:meta`;
|
||||
sub.Authors = new Set([pubKey]);
|
||||
sub.Kinds = new Set([EventKind.ContactList, EventKind.SetMetadata]);
|
||||
sub.Limit = 2
|
||||
|
||||
return sub;
|
||||
}, [pubKey]);
|
||||
@ -92,7 +93,7 @@ export default function useLoginFeed() {
|
||||
dispatch(setRelays({ relays, createdAt: cl.created_at }));
|
||||
}
|
||||
let pTags = cl.tags.filter(a => a[0] === "p").map(a => a[1]);
|
||||
dispatch(setFollows(pTags));
|
||||
dispatch(setFollows({ keys: pTags, createdAt: cl.created_at }));
|
||||
}
|
||||
|
||||
(async () => {
|
||||
|
@ -27,7 +27,7 @@ export default function useMutedFeed(pubkey: HexKey) {
|
||||
return useSubscription(sub);
|
||||
}
|
||||
|
||||
export function getMutedKeys(rawNotes: TaggedRawEvent[]): { at: number, keys: HexKey[] } {
|
||||
export function getMutedKeys(rawNotes: TaggedRawEvent[]): { createdAt: number, keys: HexKey[] } {
|
||||
const notes = [...rawNotes]
|
||||
notes.sort((a, b) => a.created_at - b.created_at)
|
||||
const newest = notes && notes[0]
|
||||
@ -36,12 +36,12 @@ export function getMutedKeys(rawNotes: TaggedRawEvent[]): { at: number, keys: He
|
||||
const mutedIndex = tags.findIndex(t => t[0] === "d" && t[1] === MUTE_LIST_TAG)
|
||||
if (mutedIndex !== -1) {
|
||||
return {
|
||||
at: newest.created_at,
|
||||
createdAt: newest.created_at,
|
||||
keys: tags.slice(mutedIndex).filter(t => t[0] === "p").map(t => t[1])
|
||||
}
|
||||
}
|
||||
}
|
||||
return { at: 0, keys: [] }
|
||||
return { createdAt: 0, keys: [] }
|
||||
}
|
||||
|
||||
export function getMuted(feed: NoteStore, pubkey: HexKey): HexKey[] {
|
||||
|
Reference in New Issue
Block a user