From e1d55be242e7fdc32e32a320fab6ddba0d7e640f Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sat, 16 Apr 2022 00:28:03 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20genshin=20toolbox=E5=A2=9E=E5=8A=A0load?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/plugins/com.msgbyte.genshin/src/GenshinPanel/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/plugins/com.msgbyte.genshin/src/GenshinPanel/index.tsx b/web/plugins/com.msgbyte.genshin/src/GenshinPanel/index.tsx index 4e54016b..08f2522a 100644 --- a/web/plugins/com.msgbyte.genshin/src/GenshinPanel/index.tsx +++ b/web/plugins/com.msgbyte.genshin/src/GenshinPanel/index.tsx @@ -2,13 +2,13 @@ import React from 'react'; import { Translate } from '../translate'; import { OfficialGachaIndex, OfficialGachaType, util } from 'genshin-gacha-kit'; import { useAsync } from '@capital/common'; -import { PillTabs, PillTabPane } from '@capital/component'; +import { PillTabs, PillTabPane, LoadingSpinner } from '@capital/component'; import { GachaPool } from './GachaPool'; import _groupBy from 'lodash/groupBy'; import './index.less'; const GenshinPanel: React.FC = React.memo(() => { - const { value: gachaList } = useAsync(async () => { + const { value: gachaList, loading } = useAsync(async () => { const gacha = await util.getGachaIndex(); const dict = _groupBy(gacha, 'gacha_type') as unknown as Record< keyof OfficialGachaType, @@ -30,6 +30,8 @@ const GenshinPanel: React.FC = React.memo(() => { {Translate.genshin} - {Translate.gacha} + {loading && } + {(gachaList ?? []).map((item) => (