diff --git a/apps/client/src/services/branches.ts b/apps/client/src/services/branches.ts
index 05dc5b997..5672fa370 100644
--- a/apps/client/src/services/branches.ts
+++ b/apps/client/src/services/branches.ts
@@ -216,7 +216,7 @@ ws.subscribeToMessages(async (message) => {
toastService.showPersistent(makeToast(message.taskId, t("branches.delete-notes-in-progress", { count: message.progressCount })));
} else if (message.type === "taskSucceeded") {
const toast = makeToast(message.taskId, t("branches.delete-finished-successfully"));
- toast.delay = 5000;
+ toast.timeout = 5000;
toastService.showPersistent(toast);
}
@@ -234,7 +234,7 @@ ws.subscribeToMessages(async (message) => {
toastService.showPersistent(makeToast(message.taskId, t("branches.undeleting-notes-in-progress", { count: message.progressCount })));
} else if (message.type === "taskSucceeded") {
const toast = makeToast(message.taskId, t("branches.undeleting-notes-finished-successfully"));
- toast.delay = 5000;
+ toast.timeout = 5000;
toastService.showPersistent(toast);
}
diff --git a/apps/client/src/services/import.ts b/apps/client/src/services/import.ts
index c6557c21d..3e54fd4a3 100644
--- a/apps/client/src/services/import.ts
+++ b/apps/client/src/services/import.ts
@@ -78,7 +78,7 @@ ws.subscribeToMessages(async (message) => {
toastService.showPersistent(makeToast(message.taskId, t("import.in-progress", { progress: message.progressCount })));
} else if (message.type === "taskSucceeded") {
const toast = makeToast(message.taskId, t("import.successful"));
- toast.delay = 5000;
+ toast.timeout = 5000;
toastService.showPersistent(toast);
@@ -100,7 +100,7 @@ ws.subscribeToMessages(async (message: WebSocketMessage) => {
toastService.showPersistent(makeToast(message.taskId, t("import.in-progress", { progress: message.progressCount })));
} else if (message.type === "taskSucceeded") {
const toast = makeToast(message.taskId, t("import.successful"));
- toast.delay = 5000;
+ toast.timeout = 5000;
toastService.showPersistent(toast);
diff --git a/apps/client/src/services/protected_session.ts b/apps/client/src/services/protected_session.ts
index 068b63014..e9382a16c 100644
--- a/apps/client/src/services/protected_session.ts
+++ b/apps/client/src/services/protected_session.ts
@@ -124,7 +124,7 @@ ws.subscribeToMessages(async (message) => {
} else if (message.type === "taskSucceeded") {
const text = isProtecting ? t("protected_session.protecting-finished-successfully") : t("protected_session.unprotecting-finished-successfully");
const toast = makeToast(message, title, text);
- toast.delay = 3000;
+ toast.timeout = 3000;
toastService.showPersistent(toast);
}
diff --git a/apps/client/src/services/toast.ts b/apps/client/src/services/toast.ts
index a39768144..a7d11988d 100644
--- a/apps/client/src/services/toast.ts
+++ b/apps/client/src/services/toast.ts
@@ -7,7 +7,7 @@ export interface ToastOptions {
icon: string;
title?: string;
message: string;
- delay?: number;
+ timeout?: number;
autohide?: boolean;
progress?: number;
}
@@ -28,29 +28,29 @@ function closePersistent(id: string) {
removeToastFromStore(id);
}
-function showMessage(message: string, delay = 2000, icon = "bx bx-check") {
+function showMessage(message: string, timeout = 2000, icon = "bx bx-check") {
console.debug(utils.now(), "message:", message);
addToast({
icon,
message,
autohide: true,
- delay
+ timeout
});
}
-export function showError(message: string, delay = 10000) {
+export function showError(message: string, timeout = 10000) {
console.log(utils.now(), "error: ", message);
addToast({
icon: "bx bx-error-circle",
message,
autohide: true,
- delay
+ timeout
})
}
-function showErrorTitleAndMessage(title: string, message: string, delay = 10000) {
+function showErrorTitleAndMessage(title: string, message: string, timeout = 10000) {
console.log(utils.now(), "error: ", message);
addToast({
@@ -58,7 +58,7 @@ function showErrorTitleAndMessage(title: string, message: string, delay = 10000)
icon: "bx bx-error-circle",
message,
autohide: true,
- delay
+ timeout
});
}
diff --git a/apps/client/src/widgets/Toast.tsx b/apps/client/src/widgets/Toast.tsx
index 02ed6d397..5d4cbc5a7 100644
--- a/apps/client/src/widgets/Toast.tsx
+++ b/apps/client/src/widgets/Toast.tsx
@@ -17,13 +17,13 @@ export default function ToastContainer() {
)
}
-function Toast({ id, title, autohide, delay, progress, message, icon }: ToastOptionsWithRequiredId) {
+function Toast({ id, title, autohide, timeout, progress, message, icon }: ToastOptionsWithRequiredId) {
// Autohide.
useEffect(() => {
if (!autohide || !id) return;
- const timeout = setTimeout(() => removeToastFromStore(id), delay || DEFAULT_DELAY);
- return () => clearTimeout(timeout);
- }, [ autohide, id, delay ]);
+ const timerId = setTimeout(() => removeToastFromStore(id), timeout || DEFAULT_DELAY);
+ return () => clearTimeout(timerId);
+ }, [ autohide, id, timeout ]);
const closeButton = ;
const toastIcon = ;
diff --git a/apps/client/src/widgets/dialogs/export.tsx b/apps/client/src/widgets/dialogs/export.tsx
index aaad8ab31..a8682df80 100644
--- a/apps/client/src/widgets/dialogs/export.tsx
+++ b/apps/client/src/widgets/dialogs/export.tsx
@@ -152,7 +152,7 @@ ws.subscribeToMessages(async (message) => {
toastService.showPersistent(makeToast(message.taskId, t("export.export_in_progress", { progressCount: message.progressCount })));
} else if (message.type === "taskSucceeded") {
const toast = makeToast(message.taskId, t("export.export_finished_successfully"));
- toast.delay = 5000;
+ toast.timeout = 5000;
toastService.showPersistent(toast);
}
diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsx
index 720acfdcd..9796a6d4f 100644
--- a/apps/client/src/widgets/react/hooks.tsx
+++ b/apps/client/src/widgets/react/hooks.tsx
@@ -737,7 +737,7 @@ export function useNoteTreeDrag(containerRef: MutableRef