diff --git a/packages/rocketchat-lazy-load/client/index.js b/packages/rocketchat-lazy-load/client/index.js index 884a7e46b5bd..0abdd090d39d 100644 --- a/packages/rocketchat-lazy-load/client/index.js +++ b/packages/rocketchat-lazy-load/client/index.js @@ -58,7 +58,8 @@ const isVisible = (el, instance) => { window.addEventListener('resize', window.lazyloadtick); export const lazyloadtick = _.debounce(() => { - [...document.querySelectorAll('.lazy-img[data-src]')].forEach((el) => + const lazyImg = document.querySelectorAll('.lazy-img[data-src]'); + Array.from(lazyImg).forEach((el) => isVisible(el, Blaze.getView(el)._templateInstance) ); }, 300); diff --git a/packages/rocketchat-lib/client/lib/roomExit.js b/packages/rocketchat-lib/client/lib/roomExit.js index df61dc33d58a..c6daea088cd4 100644 --- a/packages/rocketchat-lib/client/lib/roomExit.js +++ b/packages/rocketchat-lib/client/lib/roomExit.js @@ -23,7 +23,7 @@ this.roomExit = function() { if (mainNode == null) { return; } - return [...mainNode.children].forEach((child) => { + return Array.from(mainNode.children).forEach((child) => { if (child == null) { return; } diff --git a/packages/rocketchat-ui/client/lib/sideNav.js b/packages/rocketchat-ui/client/lib/sideNav.js index cda0d349974c..a7193113f37c 100644 --- a/packages/rocketchat-ui/client/lib/sideNav.js +++ b/packages/rocketchat-ui/client/lib/sideNav.js @@ -73,7 +73,7 @@ SideNav = new class { //eslint-disable-line } } focusInput() { - const sideNavDivs = [...this.sideNav[0].children].filter((el) => el.tagName === 'DIV' && !el.classList.contains('hidden')); + const sideNavDivs = Array.from(this.sideNav[0].children).filter((el) => el.tagName === 'DIV' && !el.classList.contains('hidden')); let highestZidx = 0; let highestZidxElem; sideNavDivs.forEach((el) => {