Skip to content

Commit

Permalink
Remove Toast (#291)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yatharth-b authored Feb 26, 2024
1 parent 072dd40 commit 1474927
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/components/HeaderDisplay/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react';
import React, { useState } from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
faBars,
Expand All @@ -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';

Expand Down Expand Up @@ -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 (
<div className="Header">
Expand Down

0 comments on commit 1474927

Please sign in to comment.