From b6461c6fc2e2901cad61883dacbc831a2379b554 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Thu, 9 Sep 2021 05:59:55 +0430 Subject: [PATCH] fix the toast system? --- src/components/Toast.tsx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/components/Toast.tsx b/src/components/Toast.tsx index dd70e232..a09dbea5 100644 --- a/src/components/Toast.tsx +++ b/src/components/Toast.tsx @@ -10,7 +10,6 @@ import React from 'react'; import Slide, { SlideProps } from '@material-ui/core/Slide'; import Snackbar from '@material-ui/core/Snackbar'; import MuiAlert, { Color as Severity } from '@material-ui/lab/Alert'; -import cloneObject from 'util/cloneObject'; function removeToast(id: string) { const container = document.querySelector(`#${id}`)!!; @@ -68,14 +67,10 @@ export function makeToaster( (arg0: React.ReactElement[]) => void], ): [React.ReactElement[], ((message: string, severity: Severity) => void)] { return [toasts, (message: string, severity: Severity) => { - const curToasts = cloneObject(toasts); - curToasts.push( - , - ); - setToasts(curToasts); + setToasts([]); }]; }