Skip to content

Commit

Permalink
fix(search): Fix undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
kreafox committed Feb 10, 2023
1 parent 13b5e64 commit 613d358
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
import config from '@plone/volto/registry';

const getRandomItems = (arr, max) => {
return arr?.slice(0, max).map(function () {
return this.splice(Math.floor(Math.random() * this.length), 1)[0];
}, arr.slice());
return (
arr?.slice(0, max).map(function () {
return this.splice(Math.floor(Math.random() * this.length), 1)[0];
}, arr.slice()) || []
);
};

function HeaderSearchPopUp({
Expand Down

0 comments on commit 613d358

Please sign in to comment.