Skip to content

Commit e2b061f

Browse files
committed
removed if statement from line 52 of errorContainer
1 parent cbd339a commit e2b061f

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/app/containers/ErrorContainer.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,16 @@ function ErrorContainer(props: ErrorContainerProps): JSX.Element {
5050

5151
// hook that sets timer while waiting for a snapshot from the background script, resets if the tab changes/reloads
5252
useEffect(() => {
53-
if (tabs[currentTab])
54-
// We declare a function
55-
function setLoadingArray(i: number, value: boolean) {
56-
// 'setLoadingArray' checks an element in our 'loadingArray' local state and compares it with passed in boolean argument. If they don't match, we update our local state replacing the selected element with the boolean argument
57-
if (loadingArray[i] !== value) {
58-
// this conditional helps us avoid unecessary state changes if the element and the value are already the same
59-
const loadingArrayClone = [...loadingArray];
60-
loadingArrayClone[i] = value;
61-
setLoading(loadingArrayClone);
62-
}
53+
// We declare a function
54+
function setLoadingArray(i: number, value: boolean) {
55+
// 'setLoadingArray' checks an element in our 'loadingArray' local state and compares it with passed in boolean argument. If they don't match, we update our local state replacing the selected element with the boolean argument
56+
if (loadingArray[i] !== value) {
57+
// this conditional helps us avoid unecessary state changes if the element and the value are already the same
58+
const loadingArrayClone = [...loadingArray];
59+
loadingArrayClone[i] = value;
60+
setLoading(loadingArrayClone);
6361
}
62+
}
6463

6564
if (titleTracker.current !== currentTitle) {
6665
// if the current tab changes/reloads, we reset loadingArray to it's default [true, true, true]

0 commit comments

Comments
 (0)