@jetthai/cuora 1.1.353-dev-6 → 1.1.353-dev-8

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.353-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-7...v1.1.353-dev-8) (2025-04-15)
6
+
7
+ ### [1.1.353-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-6...v1.1.353-dev-7) (2025-04-14)
8
+
5
9
  ### [1.1.353-dev-6](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-5...v1.1.353-dev-6) (2025-04-14)
6
10
 
7
11
  ### [1.1.353-dev-6](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-5...v1.1.353-dev-6) (2025-04-14)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.353-dev-6",
3
+ "version": "1.1.353-dev-8",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -1,9 +1,9 @@
1
1
  export default {
2
2
  // 未登入排名資料
3
- getTournament: ({ activityNo }) => ({
3
+ getTournament: ({ activityNo, cycle, round, site }) => ({
4
4
  url: 'tournament/detail',
5
5
  method: 'post',
6
- params: { activityNo, cycle, round },
6
+ params: { activityNo, cycle, round, site },
7
7
  isPublic: true,
8
8
  }),
9
9
  // 登入後排名預設期數資料
@@ -24,6 +24,7 @@ export default function (request) {
24
24
  initial: 'idle',
25
25
  context: {
26
26
  auth: false,
27
+ site: '',
27
28
  activityNo: '',
28
29
  // api options 回傳的資料
29
30
  currentRound: [],
@@ -58,36 +59,32 @@ export default function (request) {
58
59
  },
59
60
  setting: {
60
61
  entry: 'setOptions',
61
- always: [{ target: 'getRankingDetail' }],
62
+ always: [{ target: 'getRankingDetail', cond: 'hasAuth' }, { target: 'getTournament' }],
62
63
  },
63
64
  // 取得排名選單資料
64
65
  getRankingOptions: {
65
66
  invoke: {
66
67
  src: 'fetchRankingOptions',
67
- onDone: [
68
- // 有登入且為冠軍: 先拿遊戲排行榜再拿排行榜資料
69
- {
70
- cond: 'canGetGameRanking',
71
- target: 'getRankingGames',
72
- actions: 'setRankingOptions',
73
- },
74
- // 有登入但不為冠軍活動: 直接拿排行榜資料
75
- {
76
- cond: 'hasAuth',
77
- target: 'getRankingDetail',
78
- actions: 'setRankingOptions',
79
- },
80
- // 未登入; 拿未登入的排行榜資料
81
- {
82
- target: 'getTournament',
83
- actions: 'setRankingOptions',
84
- },
85
- ],
68
+ onDone: {
69
+ target: 'decideNextAfterOptions',
70
+ actions: 'setRankingOptions',
71
+ },
86
72
  onError: {
87
73
  target: 'idle',
88
74
  },
89
75
  },
90
76
  },
77
+ // 取得排名選單資料後的跳轉
78
+ decideNextAfterOptions: {
79
+ always: [
80
+ // 有登入且為冠軍: 先拿遊戲排行榜再拿排行榜資料
81
+ { target: 'getRankingGames', cond: 'canGetGameRanking' },
82
+ // 有登入但不為冠軍活動: 直接拿排行榜資料
83
+ { target: 'getRankingDetail', cond: 'hasAuth' },
84
+ // 未登入; 拿未登入的排行榜資料
85
+ { target: 'getTournament' },
86
+ ],
87
+ },
91
88
  // 未登入時取得排名資料
92
89
  getTournament: {
93
90
  invoke: {
@@ -132,6 +129,7 @@ export default function (request) {
132
129
  actions: {
133
130
  setActivity: assign((context, event) => {
134
131
  return {
132
+ site: event.data?.site,
135
133
  auth: !!request.getToken(),
136
134
  activityNo: event.data?.activityNo,
137
135
  }
@@ -193,8 +191,8 @@ export default function (request) {
193
191
  },
194
192
  services: {
195
193
  fetchTournament: async (context) => {
196
- const { activityNo, cycle, round } = context
197
- const { data } = await request.send(ranking.getTournament({ activityNo, cycle, round }))
194
+ const { activityNo, cycle, round, site } = context
195
+ const { data } = await request.send(ranking.getTournament({ activityNo, cycle, round, site }))
198
196
  return data
199
197
  },
200
198
  fetchRankingOptions: async (context) => {