@jetthai/cuora 1.1.297-dev-1 → 1.1.297-dev-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -74,12 +74,14 @@ export default function (request) {
74
74
  },
75
75
  checking: {
76
76
  always: [
77
+ { target: 'claimAmountLimitReached', cond: 'isClaimAmountLimitReached' },
77
78
  { target: 'claimExhausted', cond: 'isClaimExhausted' },
78
79
  { target: 'insufficientAmount', cond: 'isInsufficientAmount' },
79
80
  { target: 'claimEnable', cond: 'isClaimEnable' },
80
81
  { target: 'cantEstimate' },
81
82
  ],
82
83
  },
84
+ claimAmountLimitReached: {},
83
85
  claimExhausted: {},
84
86
  insufficientAmount: {},
85
87
  claimEnable: {
@@ -161,6 +163,10 @@ export default function (request) {
161
163
  return parseInt(`${currentTime}`) - parseInt(`${lastEstimateTime}`) > fiveMinutes
162
164
  }
163
165
  },
166
+ isClaimAmountLimitReached: (context, event) => {
167
+ const { collectAvailable } = context
168
+ return !collectAvailable
169
+ },
164
170
  isClaimExhausted: (context, event) => {
165
171
  const { collectAvailable, remainingCount, dailyRedemptionLimit } = context
166
172
  return !collectAvailable && parseInt(`${remainingCount}`) === parseInt(`${dailyRedemptionLimit}`)
@@ -344,9 +344,9 @@ export default function (request) {
344
344
  const isCustomerReply = data[0]?.from === 'SYSTEM'
345
345
  let combindedContent = ''
346
346
  if (isCustomerReply) {
347
- combindedContent = '-\n-------------------------\n' + data[0].content + '\n-------------------------\n' + data[1].content
347
+ combindedContent = '-\n-------------------------\n' + data[0]?.content || '' + '\n-------------------------\n' + data[1]?.content || ''
348
348
  } else {
349
- combindedContent = `-\n-------------------------\n${data[0].content}`
349
+ combindedContent = `-\n-------------------------\n${data[0]?.content || ''}`
350
350
  }
351
351
  return {
352
352
  messageDetail: data,