mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Merge pull request #125 from project-error/tweak/snackbar-provider
tweak(phone/snackbarprovider): remove redunant function
This commit is contained in:
1 file changed
+2
-4
@@ -11,15 +11,13 @@ function SnackbarProvider({ children }) {
|
|||||||
clearTimeout(timer.current);
|
clearTimeout(timer.current);
|
||||||
timer.current = setTimeout(() => {
|
timer.current = setTimeout(() => {
|
||||||
setAlert(null);
|
setAlert(null);
|
||||||
}, 1000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
return () => clearTimeout(timer.current);
|
return () => clearTimeout(timer.current);
|
||||||
}, [alert]);
|
}, [alert]);
|
||||||
|
|
||||||
const addAlert = (value) => setAlert(value);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SnackbarContext.Provider value={{ addAlert, alert }}>
|
<SnackbarContext.Provider value={{ alert, addAlert: setAlert }}>
|
||||||
{children}
|
{children}
|
||||||
</SnackbarContext.Provider>
|
</SnackbarContext.Provider>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user