mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Save a bit of time at startup by avoiding to pre-fetch resources
Don't show in changelog
This commit is contained in:
@@ -108,21 +108,6 @@ export const ResourceStoreStateProvider = ({
|
||||
[resourcesByUrl, isLoading]
|
||||
);
|
||||
|
||||
React.useEffect(
|
||||
() => {
|
||||
// Don't attempt to load again resources and filters if they
|
||||
// were loaded already.
|
||||
if (resourcesByUrl || isLoading.current) return;
|
||||
|
||||
const timeoutId = setTimeout(() => {
|
||||
console.info('Pre-fetching resources from asset store...');
|
||||
fetchResourcesAndFilters();
|
||||
}, 6000);
|
||||
return () => clearTimeout(timeoutId);
|
||||
},
|
||||
[fetchResourcesAndFilters, resourcesByUrl, isLoading]
|
||||
);
|
||||
|
||||
const { chosenCategory, chosenFilters } = filtersState;
|
||||
const searchResults: ?Array<Resource> = useSearchItem(
|
||||
resourcesByUrl,
|
||||
|
Reference in New Issue
Block a user