mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Fix zap tag logic
This commit is contained in:
parent
031297f253
commit
7f8697f4f3
1 changed files with 3 additions and 2 deletions
|
|
@ -197,7 +197,8 @@ const createStatusController: AppController = async (c) => {
|
||||||
|
|
||||||
const mediaCompat = mediaUrls.length ? `\n\n${mediaUrls.join('\n')}` : '';
|
const mediaCompat = mediaUrls.length ? `\n\n${mediaUrls.join('\n')}` : '';
|
||||||
|
|
||||||
const author = await getAuthor(await c.get('signer')?.getPublicKey()!);
|
const pubkey = await c.get('signer')?.getPublicKey()!;
|
||||||
|
const author = pubkey ? await getAuthor(pubkey) : undefined;
|
||||||
|
|
||||||
if (Conf.zapSplitsEnabled) {
|
if (Conf.zapSplitsEnabled) {
|
||||||
const meta = n.json().pipe(n.metadata()).catch({}).parse(author?.content);
|
const meta = n.json().pipe(n.metadata()).catch({}).parse(author?.content);
|
||||||
|
|
@ -210,7 +211,7 @@ const createStatusController: AppController = async (c) => {
|
||||||
tags.push(['zap', pubkey, Conf.relay, dittoZapSplit[pubkey].weight.toString(), dittoZapSplit[pubkey].message]);
|
tags.push(['zap', pubkey, Conf.relay, dittoZapSplit[pubkey].weight.toString(), dittoZapSplit[pubkey].message]);
|
||||||
}
|
}
|
||||||
if (totalSplit) {
|
if (totalSplit) {
|
||||||
tags.push(['zap', author?.pubkey as string, Conf.relay, Math.max(0, 100 - totalSplit).toString()]);
|
tags.push(['zap', pubkey, Conf.relay, Math.max(0, 100 - totalSplit).toString()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue