mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-10-01 17:31:13 +00:00
Allow guests to see top zaps
This commit is contained in:
parent
c5092a0c3a
commit
a55c5122f7
@ -562,14 +562,23 @@ export const getEventQuotes = (eventId: string, subid: string, offset = 0) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getEventZaps = (eventId: string, user_pubkey: string | undefined, subid: string, limit: number, offset = 0) => {
|
export const getEventZaps = (eventId: string, user_pubkey: string | undefined, subid: string, limit: number, offset = 0) => {
|
||||||
if (!user_pubkey) return;
|
|
||||||
|
|
||||||
const event_id = eventId.startsWith('note1') ? npubToHex(eventId) : eventId;
|
const event_id = eventId.startsWith('note1') ? npubToHex(eventId) : eventId;
|
||||||
|
|
||||||
|
let payload = {
|
||||||
|
event_id,
|
||||||
|
limit,
|
||||||
|
offset
|
||||||
|
};
|
||||||
|
|
||||||
|
if (user_pubkey) {
|
||||||
|
// @ts-ignore
|
||||||
|
payload.user_pubkey = user_pubkey;
|
||||||
|
}
|
||||||
|
|
||||||
sendMessage(JSON.stringify([
|
sendMessage(JSON.stringify([
|
||||||
"REQ",
|
"REQ",
|
||||||
subid,
|
subid,
|
||||||
{cache: ["event_zaps_by_satszapped", { event_id, user_pubkey, limit, offset }]},
|
{cache: ["event_zaps_by_satszapped", { ...payload }]},
|
||||||
]));
|
]));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user