From 0e43d1e8a765f22477949d69191b84810bc1ae51 Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Tue, 23 Jul 2024 22:40:38 -0300 Subject: [PATCH] refactor: add zap tag with new data structure --- src/controllers/api/statuses.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/api/statuses.ts b/src/controllers/api/statuses.ts index 4b29aea2..e222608c 100644 --- a/src/controllers/api/statuses.ts +++ b/src/controllers/api/statuses.ts @@ -183,8 +183,8 @@ const createStatusController: AppController = async (c) => { if (lnurl && zap_split) { let totalSplit = 0; for (const pubkey in zap_split) { - totalSplit += Number(zap_split[pubkey][0]); - tags.push(['zap', pubkey, Conf.relay, zap_split[pubkey][0]]); + totalSplit += zap_split[pubkey].amount; + tags.push(['zap', pubkey, Conf.relay, zap_split[pubkey].amount.toString()]); } if (totalSplit) { tags.push(['zap', author?.pubkey as string, Conf.relay, Math.max(0, 100 - totalSplit).toString()]);