mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 21:30:17 +08:00
fix(skills): show loading indicator when refreshing discovery list
Use isFetching instead of just isLoading to show the loading spinner. isLoading is only true on initial load, while isFetching is true during any fetch operation including refetch.
This commit is contained in:
@@ -54,6 +54,7 @@ export const SkillsPage = forwardRef<SkillsPageHandle, SkillsPageProps>(
|
||||
const {
|
||||
data: discoverableSkills,
|
||||
isLoading: loadingDiscoverable,
|
||||
isFetching: fetchingDiscoverable,
|
||||
refetch: refetchDiscoverable,
|
||||
} = useDiscoverableSkills();
|
||||
const { data: installedSkills } = useInstalledSkills();
|
||||
@@ -86,7 +87,7 @@ export const SkillsPage = forwardRef<SkillsPageHandle, SkillsPageProps>(
|
||||
});
|
||||
}, [discoverableSkills, installedDirs]);
|
||||
|
||||
const loading = loadingDiscoverable;
|
||||
const loading = loadingDiscoverable || fetchingDiscoverable;
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
refresh: () => {
|
||||
|
||||
Reference in New Issue
Block a user