feat: added delay to toast appearing to avoid conflicting with messages/node loading.
This commit is contained in:
@@ -17,6 +17,8 @@ interface ReminderState {
|
||||
lastShown: string;
|
||||
}
|
||||
|
||||
const TOAST_DELAY = 10000;
|
||||
|
||||
export function useBackupReminder({
|
||||
suppressDays = 365,
|
||||
message = "It's time to back up your key data. Would you like to do this now?",
|
||||
@@ -47,6 +49,7 @@ export function useBackupReminder({
|
||||
|
||||
useEffect(() => {
|
||||
if (!reminderState) {
|
||||
setTimeout(() => {
|
||||
const { dismiss: dimissToast } = toast({
|
||||
title: "Backup Reminder",
|
||||
description: message,
|
||||
@@ -76,6 +79,7 @@ export function useBackupReminder({
|
||||
</div>
|
||||
),
|
||||
});
|
||||
}, TOAST_DELAY);
|
||||
}
|
||||
}, [reminderState]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user