chore: improve toast and show once
This commit is contained in:
		| @@ -1,5 +1,5 @@ | ||||
| import SectionContainer from '../../components/SectionContainer'; | ||||
| import { useEffect, useState } from 'react'; | ||||
| import { useEffect, useState, useRef } from 'react'; | ||||
| import { DataGrid } from '@mui/x-data-grid'; | ||||
| import { Typography, Button, Dialog, DialogTitle, DialogContent, IconButton, Box } from '@mui/material'; | ||||
| import EditRoundedIcon from '@mui/icons-material/EditRounded'; | ||||
| @@ -42,11 +42,14 @@ export default function Admin() { | ||||
|     const [rowToDelete, setRowToDelete] = useState(null); | ||||
|     const { handleError } = useApiToast(); | ||||
|  | ||||
|     useEffect(() => { | ||||
|         let isMounted = true; | ||||
|         loadData(); | ||||
|         return () => { isMounted = false }; | ||||
|     }, []); | ||||
| const hasLoaded = useRef(false); | ||||
|  | ||||
| useEffect(() => { | ||||
|   if (!hasLoaded.current) { | ||||
|     loadData(); | ||||
|     hasLoaded.current = true; | ||||
|   } | ||||
| }, []); | ||||
|  | ||||
|     const handleEditClick = (params) => { | ||||
|         setEditingData(params.row); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Rodolfo Ruiz
					Rodolfo Ruiz