feat: render polls
This commit is contained in:
@ -38,6 +38,7 @@ export function parseZap(zapReceipt: TaggedRawEvent, refNote?: TaggedRawEvent):
|
||||
const isForwardedZap = refNote?.tags.some(a => a[0] === "zap") ?? false;
|
||||
const anonZap = findTag(zapRequest, "anon");
|
||||
const metaHash = sha256(innerZapJson);
|
||||
const pollOpt = zapRequest.tags.find(a => a[0] === "poll_option")?.[1];
|
||||
const ret: ParsedZap = {
|
||||
id: zapReceipt.id,
|
||||
zapService: zapReceipt.pubkey,
|
||||
@ -49,6 +50,7 @@ export function parseZap(zapReceipt: TaggedRawEvent, refNote?: TaggedRawEvent):
|
||||
anonZap: anonZap !== undefined,
|
||||
content: zapRequest.content,
|
||||
errors: [],
|
||||
pollOption: pollOpt ? Number(pollOpt) : undefined,
|
||||
};
|
||||
if (invoice?.descriptionHash !== metaHash) {
|
||||
ret.valid = false;
|
||||
@ -96,6 +98,7 @@ export interface ParsedZap {
|
||||
zapService: HexKey;
|
||||
anonZap: boolean;
|
||||
errors: Array<string>;
|
||||
pollOption?: number;
|
||||
}
|
||||
|
||||
const Zap = ({ zap, showZapped = true }: { zap: ParsedZap; showZapped?: boolean }) => {
|
||||
|
Reference in New Issue
Block a user