From 55d740cda09af1fbc0bb99a21e12a9fe17881dab Mon Sep 17 00:00:00 2001 From: Lam Tang Date: Sun, 13 Aug 2023 19:56:27 +0800 Subject: [PATCH] chore: let and const has their own scope --- .../features/repo-activity-racing-bar/RacingBar.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/pages/ContentScripts/features/repo-activity-racing-bar/RacingBar.tsx b/src/pages/ContentScripts/features/repo-activity-racing-bar/RacingBar.tsx index 8407b1ea..dfcb3e49 100644 --- a/src/pages/ContentScripts/features/repo-activity-racing-bar/RacingBar.tsx +++ b/src/pages/ContentScripts/features/repo-activity-racing-bar/RacingBar.tsx @@ -115,13 +115,11 @@ const RacingBar = (props: RacingBarProps): JSX.Element => { let startIndex = 0; for (let i = startIndex; i < months.length - 1; ++i) { - (function (i) { - setTimeout(function () { - updateMonth(months[i + 1]); - if (i + 1 === months.length - 1) { - } - }, (i - startIndex) * updateFrequency); - })(i); + setTimeout(function () { + updateMonth(months[i + 1]); + if (i + 1 === months.length - 1) { + } + }, (i - startIndex) * updateFrequency); } // @ts-ignore