fix missing logic
This commit is contained in:
parent
8930eef827
commit
7c8c172e73
|
@ -118,6 +118,21 @@ export function handlePredictionPayout(event: PredictionPayout): void {
|
||||||
|
|
||||||
predictPrediction.payout = predictionPayout.id
|
predictPrediction.payout = predictionPayout.id
|
||||||
predictPrediction.save()
|
predictPrediction.save()
|
||||||
|
|
||||||
|
let shouldUpdateSlot = false
|
||||||
|
const predictSlot = getPredictSlot(
|
||||||
|
event.address.toHexString(),
|
||||||
|
event.params.slot.toI32()
|
||||||
|
)
|
||||||
|
if (event.params.status == 1 && predictSlot.status !== 'Paying') {
|
||||||
|
predictSlot.status = 'Paying'
|
||||||
|
shouldUpdateSlot = true
|
||||||
|
}
|
||||||
|
if (event.params.status == 2 && predictSlot.status !== 'Canceled') {
|
||||||
|
predictSlot.status = 'Canceled'
|
||||||
|
shouldUpdateSlot = true
|
||||||
|
}
|
||||||
|
if (shouldUpdateSlot == true) predictSlot.save()
|
||||||
}
|
}
|
||||||
|
|
||||||
export function handleNewSubscription(event: NewSubscription): void {
|
export function handleNewSubscription(event: NewSubscription): void {
|
||||||
|
|
Loading…
Reference in New Issue