@jetthai/cuora 1.1.387-dev-1 → 1.1.387-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.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/api/common.js +6 -0
- package/src/machine/common.js +44 -5
- package/src/request/request.js +2 -0
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.387-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.387-dev-2...v1.1.387-dev-3) (2025-10-01)
|
|
6
|
+
|
|
7
|
+
### [1.1.387-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.387-dev-1...v1.1.387-dev-2) (2025-10-01)
|
|
8
|
+
|
|
5
9
|
### [1.1.387-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.387-dev...v1.1.387-dev-1) (2025-09-26)
|
|
6
10
|
|
|
7
11
|
### [1.1.387-dev](https://github.com/jetthai/cuora-module/compare/v1.1.387...v1.1.387-dev) (2025-09-26)
|
package/package.json
CHANGED
package/src/api/common.js
CHANGED
|
@@ -7,4 +7,10 @@ export default {
|
|
|
7
7
|
getNavbar: ({ appSecret } = {}) => ({ url: 'getNavbarSetting', params: { appSecret }, method: 'get', isPublic: true }),
|
|
8
8
|
getDefaultAffiliateCode: ({ appSecret }) => ({ url: 'getAffiliateCode', params: { appSecret }, method: 'get', isPublic: true }),
|
|
9
9
|
getSiteInfoConfig: ({ appSecret, config }) => ({ url: 'get-site-config', method: 'get', params: { appSecret, config }, isPublic: true }),
|
|
10
|
+
sendPixel: ({ appSecret, eventId, fbc, fbp, event }) => ({
|
|
11
|
+
url: 'pixel',
|
|
12
|
+
method: 'post',
|
|
13
|
+
params: { appSecret, eventId, fbc, fbp, event },
|
|
14
|
+
isPublic: true,
|
|
15
|
+
}),
|
|
10
16
|
}
|
package/src/machine/common.js
CHANGED
|
@@ -42,6 +42,7 @@ export default function (request) {
|
|
|
42
42
|
defaultAffiliateCode: null,
|
|
43
43
|
friendCode: null,
|
|
44
44
|
isPlaying: false,
|
|
45
|
+
isLogin: false,
|
|
45
46
|
},
|
|
46
47
|
states: {
|
|
47
48
|
config: {
|
|
@@ -55,7 +56,7 @@ export default function (request) {
|
|
|
55
56
|
},
|
|
56
57
|
},
|
|
57
58
|
fetching: {
|
|
58
|
-
entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel'],
|
|
59
|
+
entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel', 'setFbclid'],
|
|
59
60
|
invoke: {
|
|
60
61
|
src: 'fetchConfig',
|
|
61
62
|
onDone: [
|
|
@@ -89,8 +90,20 @@ export default function (request) {
|
|
|
89
90
|
},
|
|
90
91
|
},
|
|
91
92
|
feed: {
|
|
92
|
-
initial: '
|
|
93
|
+
initial: 'idle',
|
|
93
94
|
states: {
|
|
95
|
+
idle: {
|
|
96
|
+
on: {
|
|
97
|
+
LOGIN_REFRESH: {
|
|
98
|
+
target: 'updating',
|
|
99
|
+
actions: 'login',
|
|
100
|
+
},
|
|
101
|
+
LEAVE_GAME_REFRESH: {
|
|
102
|
+
target: 'updating',
|
|
103
|
+
actions: 'leaveGame',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
94
107
|
updating: {
|
|
95
108
|
invoke: {
|
|
96
109
|
src: 'fetchFeeds',
|
|
@@ -111,11 +124,12 @@ export default function (request) {
|
|
|
111
124
|
},
|
|
112
125
|
on: {
|
|
113
126
|
ENTER_GAME_PAUSE: {
|
|
127
|
+
target: '.idle',
|
|
114
128
|
actions: 'resetByEnterGame',
|
|
115
129
|
},
|
|
116
|
-
|
|
117
|
-
target: '.
|
|
118
|
-
actions: '
|
|
130
|
+
LOGOUT_PAUSE: {
|
|
131
|
+
target: '.idle',
|
|
132
|
+
actions: 'resetByLogout',
|
|
119
133
|
},
|
|
120
134
|
},
|
|
121
135
|
},
|
|
@@ -224,6 +238,18 @@ export default function (request) {
|
|
|
224
238
|
isMobile: userAgent?.device?.type,
|
|
225
239
|
}
|
|
226
240
|
}),
|
|
241
|
+
setFbclid: assign(() => {
|
|
242
|
+
const urlParams = new URLSearchParams(window.location.search)
|
|
243
|
+
const fbclid = urlParams.get('fbclid') || ''
|
|
244
|
+
if (fbclid !== '') {
|
|
245
|
+
const timestamp = Date.now()
|
|
246
|
+
const cookieRecord = 'fb.1.' + timestamp + '.' + fbclid
|
|
247
|
+
document.cookie = `_fbc=${cookieRecord}; path=/; max-age=${60 * 60 * 24 * 7}`
|
|
248
|
+
}
|
|
249
|
+
return {
|
|
250
|
+
fbclid,
|
|
251
|
+
}
|
|
252
|
+
}),
|
|
227
253
|
setPixel: assign(() => {
|
|
228
254
|
let urlParams = new URLSearchParams(window.location.search)
|
|
229
255
|
const pix = urlParams.get('pix') || storage.get('pix') || ''
|
|
@@ -335,6 +361,19 @@ export default function (request) {
|
|
|
335
361
|
isPlaying: false,
|
|
336
362
|
}
|
|
337
363
|
}),
|
|
364
|
+
resetByLogout: assign((context, event) => {
|
|
365
|
+
return {
|
|
366
|
+
isLogin: false,
|
|
367
|
+
broadcastList: null,
|
|
368
|
+
mailBoxInfo: null,
|
|
369
|
+
promotions: null,
|
|
370
|
+
}
|
|
371
|
+
}),
|
|
372
|
+
login: assign((context, event) => {
|
|
373
|
+
return {
|
|
374
|
+
isLogin: true,
|
|
375
|
+
}
|
|
376
|
+
}),
|
|
338
377
|
},
|
|
339
378
|
guards: {
|
|
340
379
|
isAffiliateCodeInstructionsEnable: (context, event) => {
|