Commit 2d3066fc authored by Max Alekseenko's avatar Max Alekseenko

add an explanatory comment

parent 0e571207
...@@ -51,6 +51,7 @@ export default function useMarketplaceApps(filter: string, selectedCategoryId: s ...@@ -51,6 +51,7 @@ export default function useMarketplaceApps(filter: string, selectedCategoryId: s
const fetch = useFetch(); const fetch = useFetch();
const apiFetch = useApiFetch(); const apiFetch = useApiFetch();
// Update favorite apps only when selectedCategoryId changes to avoid sortApps to be called on each favorite app click
const lastFavoriteAppsRef = React.useRef(favoriteApps); const lastFavoriteAppsRef = React.useRef(favoriteApps);
React.useEffect(() => { React.useEffect(() => {
lastFavoriteAppsRef.current = favoriteApps; lastFavoriteAppsRef.current = favoriteApps;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment