CLASSROOMIO-T-5: Educators Settings CRUD
Co-authored-by: Rotimi Best <rotimiibitoyeemma@gmail.com> Merge-request: CLASSROOMIO-MR-7 Merged-by: Digdippa Team <digdippa@gmail.com>
This commit is contained in:
committed by
Space Cloud
co-authored by
Rotimi Best
parent
01a1f0f907
commit
5f14b36ef8
@@ -9,13 +9,19 @@
|
||||
import { snackbarStore, snackbarStoreInitialState } from './store';
|
||||
|
||||
let severityColor;
|
||||
let timeoutId;
|
||||
|
||||
function handleClose() {
|
||||
if (typeof $snackbarStore.handleClose === 'number') {
|
||||
$snackbarStore.handleClose();
|
||||
}
|
||||
|
||||
snackbarStore.set(snackbarStoreInitialState);
|
||||
snackbarStore.update((_s) => ({
|
||||
..._s,
|
||||
...snackbarStoreInitialState,
|
||||
}));
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = null;
|
||||
}
|
||||
|
||||
// When open is true trigger autoHideDuration
|
||||
@@ -26,8 +32,9 @@
|
||||
|
||||
const { autoHideDuration } = $snackbarStore;
|
||||
|
||||
if (typeof autoHideDuration === 'number') {
|
||||
setTimeout(handleClose, autoHideDuration);
|
||||
if (typeof autoHideDuration === 'number' && !timeoutId) {
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = setTimeout(handleClose, autoHideDuration);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user