Skip to content

Commit

Permalink
fix: pull Genshin's anthology gacha
Browse files Browse the repository at this point in the history
  • Loading branch information
lgou2w committed Mar 13, 2024
1 parent b58ed21 commit f2bb3b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/gacha/toolbar/GachaActionFetch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ export default function GachaActionFetch () {

const { facet, uid, gachaUrl } = selectedAccount
try {
const { namedValues: { character, weapon, permanent, newbie } } = gachaRecords
const { namedValues: { character, weapon, permanent, newbie, anthology } } = gachaRecords
const pullNewbie = shouldPullNewbie(facet, newbie)
await pull(facet, uid, {
gachaUrl,
gachaTypeAndLastEndIdMappings: {
[character.gachaType]: character.lastEndId ?? null,
[weapon.gachaType]: weapon.lastEndId ?? null,
[permanent.gachaType]: permanent.lastEndId ?? null,
...(anthology ? { [anthology.gachaType]: anthology.lastEndId ?? null } : {}),
...(pullNewbie || {})
},
eventChannel: 'gachaRecords-fetcher-event-channel',
Expand Down Expand Up @@ -119,7 +120,7 @@ function stringifyFragment (
} else if ('ready' in fragment) {
const gachaType = fragment.ready
const category = gachaRecords.gachaTypeToCategoryMappings[gachaType]
const categoryTitle = gachaRecords.namedValues[category].categoryTitle
const categoryTitle = gachaRecords.namedValues[category]?.categoryTitle || category
return `开始获取数据:${categoryTitle}`
} else if ('pagination' in fragment) {
const pagination = fragment.pagination
Expand Down

0 comments on commit f2bb3b3

Please sign in to comment.