feat: added delay to toast appearing to avoid conflicting with messages/node loading.

This commit is contained in:
Dan Ditomaso
2025-01-06 16:00:13 -05:00
parent 7cd03c6a52
commit cbabcd4782
+4
View File
@@ -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]);