Skip to content

Commit

Permalink
add an explanatory comment
Browse files Browse the repository at this point in the history
  • Loading branch information
maxaleks committed Feb 16, 2024
1 parent 0e57120 commit 2d3066f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ui/marketplace/useMarketplaceApps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default function useMarketplaceApps(filter: string, selectedCategoryId: s
const fetch = useFetch();
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);
React.useEffect(() => {
lastFavoriteAppsRef.current = favoriteApps;
Expand Down

0 comments on commit 2d3066f

Please sign in to comment.