From 1474927b20af2387d6a3412d104f03cd25ee3ec9 Mon Sep 17 00:00:00 2001 From: Yatharth Bhargava <52095139+yatharth-b@users.noreply.github.com> Date: Tue, 27 Feb 2024 04:43:53 +0530 Subject: [PATCH] Remove Toast (#291) Toast seems to have some bugs because it triggers on every re-render of HeaderDisplay. HeaderDisplay is being re-rendered for no reaason at all sometimes. --- src/components/HeaderDisplay/index.tsx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/HeaderDisplay/index.tsx b/src/components/HeaderDisplay/index.tsx index 6975bbc2..d80b0ab5 100644 --- a/src/components/HeaderDisplay/index.tsx +++ b/src/components/HeaderDisplay/index.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState } from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faBars, @@ -18,7 +18,7 @@ import HeaderActionBar from '../HeaderActionBar'; import Modal from '../Modal'; import { AccountContextValue } from '../../contexts/account'; import { Term } from '../../types'; -import Toast, { notifyToast } from '../Toast'; +import Toast from '../Toast'; import './stylesheet.scss'; @@ -92,17 +92,17 @@ export default function HeaderDisplay({ // (small mobile is < 600 px wide) const largeMobile = useScreenWidth(LARGE_MOBILE_BREAKPOINT); - useEffect(() => { - if (termsState.type === 'loaded' && !skeleton) { - const termObject = termsState.terms.filter( - (term) => term.term === termsState.currentTerm - )[0]; + // useEffect(() => { + // if (termsState.type === 'loaded' && !skeleton) { + // const termObject = termsState.terms.filter( + // (term) => term.term === termsState.currentTerm + // )[0]; - if (!termObject?.finalized) { - notifyToast('finalized-term-toast'); - } - } - }); + // if (!termObject?.finalized) { + // notifyToast('finalized-term-toast'); + // } + // } + // }); return (