From f2bb3b31628c119b09e0f12d5bddc26210c881a4 Mon Sep 17 00:00:00 2001 From: lgou2w Date: Wed, 13 Mar 2024 12:39:37 +0800 Subject: [PATCH] fix: pull Genshin's anthology gacha --- src/components/gacha/toolbar/GachaActionFetch.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/gacha/toolbar/GachaActionFetch.tsx b/src/components/gacha/toolbar/GachaActionFetch.tsx index 6c664d22..b0be29b4 100644 --- a/src/components/gacha/toolbar/GachaActionFetch.tsx +++ b/src/components/gacha/toolbar/GachaActionFetch.tsx @@ -35,7 +35,7 @@ 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, @@ -43,6 +43,7 @@ export default function GachaActionFetch () { [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', @@ -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