mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-03 11:22:25 +00:00
Fix zap tracking amount reference
This commit is contained in:
1 parent
76e063e8f6
commit
c9ea82a6dc
1 file changed
+10
-19
+10
-19
@@ -555,18 +555,18 @@ function createZapDependencies({ creatorEntry, platformEntry, shares, shareTrack
|
||||
}
|
||||
},
|
||||
sendPayment: async (bolt11, params) => {
|
||||
const shareType = activeShare || "unknown";
|
||||
const amount =
|
||||
shareType === "platform"
|
||||
? shares.platformShare
|
||||
: shares.creatorShare;
|
||||
const address =
|
||||
shareType === "platform"
|
||||
? platformEntry?.address || getCachedPlatformLightningAddress()
|
||||
: creatorEntry?.address || currentChannelLightningAddress;
|
||||
try {
|
||||
const payment = await sendPayment(bolt11, params);
|
||||
if (Array.isArray(shareTracker)) {
|
||||
const shareType = activeShare || "unknown";
|
||||
const amount =
|
||||
shareType === "platform"
|
||||
? shares.platformShare
|
||||
: shares.creatorShare;
|
||||
const address =
|
||||
shareType === "platform"
|
||||
? platformEntry?.address || getCachedPlatformLightningAddress()
|
||||
: creatorEntry?.address || currentChannelLightningAddress;
|
||||
shareTracker.push({
|
||||
type: shareType,
|
||||
status: "success",
|
||||
@@ -578,15 +578,6 @@ function createZapDependencies({ creatorEntry, platformEntry, shares, shareTrack
|
||||
return payment;
|
||||
} catch (error) {
|
||||
if (Array.isArray(shareTracker)) {
|
||||
const shareType = activeShare || "unknown";
|
||||
const amount =
|
||||
shareType === "platform"
|
||||
? shares.platformShare
|
||||
: shares.creatorShare;
|
||||
const address =
|
||||
shareType === "platform"
|
||||
? platformEntry?.address || getCachedPlatformLightningAddress()
|
||||
: creatorEntry?.address || currentChannelLightningAddress;
|
||||
shareTracker.push({
|
||||
type: shareType,
|
||||
status: "error",
|
||||
@@ -598,7 +589,7 @@ function createZapDependencies({ creatorEntry, platformEntry, shares, shareTrack
|
||||
logZapError(
|
||||
"wallet.sendPayment",
|
||||
{
|
||||
shareType: activeShare || "unknown",
|
||||
shareType,
|
||||
amount,
|
||||
address,
|
||||
tracker: shareTracker,
|
||||
|
||||
Reference in new issue
Block a user