Reactions modal uses zaps sorted by sats API

This commit is contained in:
Bojan Mojsilovic 2024-04-16 13:04:39 +02:00
parent 78b430264e
commit e359b127a2
2 changed files with 12 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import { Kind } from '../../constants';
import { ReactionStats } from '../../contexts/AppContext';
import { hookForDev } from '../../lib/devTools';
import { hexToNpub } from '../../lib/keys';
import { getEventReactions } from '../../lib/notes';
import { getEventReactions, getEventZaps } from '../../lib/notes';
import { truncateNumber, truncateNumber2 } from '../../lib/notifications';
import { subscribeTo } from '../../sockets';
import { userName } from '../../stores/profile';
@ -178,7 +178,8 @@ const ReactionsModal: Component<{
});
setIsFetching(() => true);
getEventReactions(props.noteId, Kind.Zap, subId, offset);
getEventZaps(props.noteId, subId, 20, offset);
// getEventReactions(props.noteId, Kind.Zap, subId, offset);
};
const getReposts = (offset = 0) => {

View File

@ -547,3 +547,12 @@ export const getEventReactions = (eventId: string, kind: number, subid: string,
{cache: ["event_actions", { event_id: eventId, kind, limit: 20, offset }]},
]));
};
export const getEventZaps = (eventId: string, subid: string, limit: number, offset = 0) => {
sendMessage(JSON.stringify([
"REQ",
subid,
{cache: ["event_zaps_by_satszapped", { event_id: eventId, limit, offset }]},
]));
};