Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Commit 94e3eac

Browse files
committed
Fix loading
1 parent 4b949dc commit 94e3eac

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

components/search/resultList.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ const ResultList = ({
8383
teamkatalogenTeam: tk?.name
8484
}
8585
}
86+
const [dpLoading, setDpLoading] = useState(true);
87+
88+
useEffect(() => {
89+
if (dataproducts) {
90+
setDpLoading(false);
91+
}
92+
}, [dataproducts]);
8693

8794
const sortArrayByTeamAndName = (array: any[], owner: string, nameKey: string) => {
8895
if (array) {
@@ -197,6 +204,13 @@ const ResultList = ({
197204
</Results>
198205
)
199206
}
207+
208+
if (dpLoading) {
209+
return <LoaderSpinner />;
210+
}
211+
212+
// Rest of your component code
213+
200214
if (dataproducts) {
201215
sortArrayByTeamAndName(dataproducts, 'owner.group', 'name')
202216
return (

0 commit comments

Comments
 (0)