@jetthai/cuora 1.1.302-dev-4 → 1.1.302-dev-6

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.1.302-dev-6](https://github.com/jetthai/cuora-module/compare/v1.1.302-dev-5...v1.1.302-dev-6) (2024-09-11)
6
+
7
+ ### [1.1.302-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.302-dev-4...v1.1.302-dev-5) (2024-09-11)
8
+
5
9
  ### [1.1.302-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.304...v1.1.302-dev-4) (2024-09-09)
6
10
 
7
11
  ### [1.1.302-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.302-dev-2...v1.1.302-dev-3) (2024-09-06)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.302-dev-4",
3
+ "version": "1.1.302-dev-6",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -16,6 +16,7 @@ export default function (request) {
16
16
  cumulativeRebateAmount: null,
17
17
  actualRebateAmount: null,
18
18
  rewardType: null,
19
+ alreadyCalculatedAfterFiveMinutes: false,
19
20
  singleMinimumAmountReceive: null,
20
21
  remainingCount: 0,
21
22
  dailyRedemptionLimit: 0,
@@ -131,8 +132,17 @@ export default function (request) {
131
132
  estimateStartTime = 0,
132
133
  estimateEndTime = 0,
133
134
  rewardType,
135
+ alreadyCalculatedAfterFiveMinutes = false,
134
136
  } = event.data
135
- return { enableCollectButton, lastCollectTime, lastEstimateTime, estimateStartTime, estimateEndTime, rewardType }
137
+ return {
138
+ enableCollectButton,
139
+ lastCollectTime,
140
+ lastEstimateTime,
141
+ estimateStartTime,
142
+ estimateEndTime,
143
+ rewardType,
144
+ alreadyCalculatedAfterFiveMinutes,
145
+ }
136
146
  }),
137
147
  setEstimateResult: assign((context, event) => {
138
148
  const {
@@ -168,14 +178,12 @@ export default function (request) {
168
178
  },
169
179
  guards: {
170
180
  isEstimatable: (context, event) => {
171
- const { lastEstimateTime } = context
181
+ const { lastEstimateTime, alreadyCalculatedAfterFiveMinutes } = context
172
182
  const currentTime = new Date().getTime() / 1000
173
- if (Math.floor(`${currentTime}`) === Math.floor(`${lastEstimateTime}`)) {
174
- return true
175
- } else {
176
- const fiveMinutes = 60 * 5
177
-
183
+ if (alreadyCalculatedAfterFiveMinutes) {
178
184
  return Math.floor(`${currentTime}`) - Math.floor(`${lastEstimateTime}`) > fiveMinutes
185
+ } else {
186
+ return true
179
187
  }
180
188
  },
181
189
  isClaimAmountLimitReached: (context, event) => {