mirror of
https://bitbucket.org/Mattrixwv/mattrixwvreactcomponents.git
synced 2025-12-07 06:03:58 -05:00
Update dependency versions
This commit is contained in:
@@ -24,12 +24,12 @@ export default function ToasterProvider({
|
||||
const [ toast, setToast ] = useState<Toast[]>([]);
|
||||
|
||||
|
||||
const hideToast = useCallback((id: string) => {
|
||||
const hideToast = useCallback(function hide(id: string){
|
||||
setToast((prev) => {
|
||||
if(prev.length === 1 && prev[0].id === id){
|
||||
const current = prev[0].hideTime > moment(new Date()).subtract(600, "ms").toDate() ? [...prev] : [];
|
||||
if(current.length > 0){
|
||||
setTimeout(() => hideToast(id), 600);
|
||||
setTimeout(() => hide(id), 600);
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user