Skip to content

Commit fc906a3

Browse files
committed
Fix: Set streaming payment isCancelled property
1 parent 1dd0d3c commit fc906a3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/handlers/expenditures/helpers/handleEditOrCancelStreamingPaymentAction.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ export const handleEditOrCancelStreamingPaymentAction = async ({
116116
}
117117
}
118118

119+
// When a streaming payment is cancelled, the endTime is set to the current block timestamp
120+
// Therefore, if the endTime and timestamp are equal, we can assume this is a cancel action
121+
const isCancelAction = BigNumber.from(timestamp).eq(newValues.endTime);
122+
119123
await mutate<
120124
UpdateStreamingPaymentMutation,
121125
UpdateStreamingPaymentMutationVariables
@@ -126,13 +130,10 @@ export const handleEditOrCancelStreamingPaymentAction = async ({
126130
endTime: newValues.endTime,
127131
amount: newValues.amount,
128132
interval: newValues.interval,
133+
isCancelled: isCancelAction || undefined,
129134
},
130135
});
131136

132-
// When a streaming payment is cancelled, the endTime is set to the current block timestamp
133-
// Therefore, if the endTime and timestamp are equal, we can assume this is a cancel action
134-
const isCancelAction = BigNumber.from(timestamp).eq(newValues.endTime);
135-
136137
const { agent: initiatorAddress } = event.args;
137138

138139
if (isCancelAction) {

0 commit comments

Comments
 (0)