Skip to content

Commit

Permalink
Updated findLastIndex usage to in house
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrogenous committed Mar 14, 2024
1 parent a130c7c commit 07f227d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/lib/hooks/useDisplayOrder.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const useDisplayOrder = (group, isVisible = true) => {

// Reduce array length, by removing undefined elements at the end of array:
const lastIndex = groupToDisplayedElements[group].length - 1;
const lastOrder = groupToDisplayedElements[group].findLastIndex((el) => el !== undefined);
const lastOrder = ObjectUtils.findLastIndex(groupToDisplayedElements[group], (el) => el !== undefined);

if (lastOrder !== lastIndex) groupToDisplayedElements[group].splice(lastOrder + 1);

Expand Down

0 comments on commit 07f227d

Please sign in to comment.