@jetthai/cuora 1.0.111 → 1.0.113
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 +4 -0
- package/package.json +1 -1
- package/src/api/auth.js +1 -2
- package/src/machine/common.js +27 -11
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.0.113](https://github.com/jetthai/cuora-module/compare/v1.0.112...v1.0.113) (2022-04-26)
|
|
6
|
+
|
|
7
|
+
### [1.0.112](https://github.com/jetthai/cuora-module/compare/v1.0.111...v1.0.112) (2022-04-25)
|
|
8
|
+
|
|
5
9
|
### [1.0.111](https://github.com/jetthai/cuora-module/compare/v1.0.110...v1.0.111) (2022-04-20)
|
|
6
10
|
|
|
7
11
|
### [1.0.110](https://github.com/jetthai/cuora-module/compare/v1.0.109...v1.0.110) (2022-04-15)
|
package/package.json
CHANGED
package/src/api/auth.js
CHANGED
package/src/machine/common.js
CHANGED
|
@@ -32,8 +32,10 @@ export default function (request) {
|
|
|
32
32
|
broadcastList: null,
|
|
33
33
|
mailBoxInfo: null,
|
|
34
34
|
promotions: [],
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
emergencyBroadcast: null,
|
|
36
|
+
normalBroadcast: null,
|
|
37
|
+
sentEmergencyBroadcastList: [],
|
|
38
|
+
sentNormalBroadcastList: []
|
|
37
39
|
},
|
|
38
40
|
states: {
|
|
39
41
|
config: {
|
|
@@ -166,20 +168,34 @@ export default function (request) {
|
|
|
166
168
|
return { announcementList, broadcastList, mailBoxInfo, promotions }
|
|
167
169
|
}),
|
|
168
170
|
setBroadcast: assign((context, event) => {
|
|
169
|
-
const { broadcastList,
|
|
170
|
-
let
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
const { broadcastList, sentEmergencyBroadcastList, emergencyBroadcast, sentNormalBroadcastList, normalBroadcast } = context
|
|
172
|
+
let sentEmergencyList = sentEmergencyBroadcastList
|
|
173
|
+
let sentNormalList = sentNormalBroadcastList
|
|
174
|
+
if (emergencyBroadcast) {
|
|
175
|
+
sentEmergencyList = [...sentEmergencyBroadcastList, emergencyBroadcast]
|
|
173
176
|
}
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
if (normalBroadcast) {
|
|
178
|
+
sentNormalList = [...sentNormalBroadcastList, normalBroadcast]
|
|
179
|
+
}
|
|
180
|
+
const nextEmergencyBroadcast = broadcastList?.broadcasts?.find((broadcast) => {
|
|
181
|
+
return broadcast.type === '1' && !sentEmergencyList.some((item) => item.broadcast_id === broadcast.broadcast_id)
|
|
182
|
+
})
|
|
183
|
+
const nextNormalBroadcast = broadcastList?.broadcasts?.find((broadcast) => {
|
|
184
|
+
return broadcast.type === '0' && !sentNormalList.some((item) => item.broadcast_id === broadcast.broadcast_id)
|
|
176
185
|
})
|
|
177
|
-
return {
|
|
186
|
+
return {
|
|
187
|
+
emergencyBroadcast: nextEmergencyBroadcast,
|
|
188
|
+
sentEmergencyBroadcastList: sentEmergencyList,
|
|
189
|
+
normalBroadcast: nextNormalBroadcast,
|
|
190
|
+
sentNormalBroadcastList: sentNormalList
|
|
191
|
+
}
|
|
178
192
|
}),
|
|
179
193
|
resetBroadcast: assign((context, event) => {
|
|
180
194
|
return {
|
|
181
|
-
|
|
182
|
-
|
|
195
|
+
emergencyBroadcast: null,
|
|
196
|
+
sentEmergencyBroadcastList: [],
|
|
197
|
+
normalBroadcast: null,
|
|
198
|
+
sentNormalBroadcastList: []
|
|
183
199
|
}
|
|
184
200
|
}),
|
|
185
201
|
},
|