Skip to content

Build your personal knowledge base with Trilium Notes

refactor(client): convert remaining blocking info dialogs to toasts

Elian Doranc67afcda2583
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index a8c78d1322..7982877fff 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -1779,7 +1779,7 @@
"set_password_heading": "Set Password",
"set_password": "Set Password",
"password_mismatch": "New passwords are not the same.",
- "password_changed_success": "Password has been changed. Trilium will be reloaded after you press OK."
+ "password_changed_success": "Password changed successfully."
},
"multi_factor_authentication": {
"authentication_title": "Authentication",
@@ -2849,6 +2849,15 @@
"sample_treeview": "TreeView",
"sample_wardley": "Wardley Map"
},
+ "set_password": {
+ "heading": "Set password",
+ "description": "Before you can start using Trilium from web, you need to set a password first. You will then use this password to login.",
+ "password": "Password",
+ "password-confirmation": "Password confirmation",
+ "button": "Set password",
+ "password-too-short": "Password must be at least {{length}} characters long.",
+ "passwords-dont-match": "The entered passwords don't match."
+ },
"setup": {
"heading": "Get started with Trilium",
"new-document": "New knowledge base",
diff --git a/apps/client/src/widgets/type_widgets/options/password.tsx b/apps/client/src/widgets/type_widgets/options/password.tsx
index 4de8b99230..633c8c694f 100644
--- a/apps/client/src/widgets/type_widgets/options/password.tsx
+++ b/apps/client/src/widgets/type_widgets/options/password.tsx
@@ -101,7 +101,7 @@ function ChangePasswordModal({ show, onHidden }: ChangePasswordModalProps) {
setOldPassword("");
setNewPassword1("");
setNewPassword2("");
- await dialog.info(t("password.password_changed_success"));
+ toast.showMessage(t("password.password_changed_success"));
// password changed so current protected session is invalid and needs to be cleared
protected_session_holder.resetProtectedSession();
diff --git a/apps/client/src/widgets/type_widgets/text/EditableText.tsx b/apps/client/src/widgets/type_widgets/text/EditableText.tsx
index a52e8c010c..739359e71c 100644
--- a/apps/client/src/widgets/type_widgets/text/EditableText.tsx
+++ b/apps/client/src/widgets/type_widgets/text/EditableText.tsx
@@ -387,7 +387,12 @@ function useWatchdogCrashHandling() {
timeout: 20_000
});
} else if (currentState === "crashedPermanently") {
- dialog.info(t("editable_text.keeps-crashing"));
+ toast.showPersistent({
+ id: "editor-crashed-permanently",
+ icon: "bx bx-error-circle",
+ title: t("editable_text.editor_crashed_title"),
+ message: t("editable_text.keeps-crashing")
+ });
watchdog.editor?.enableReadOnlyMode("crashed-editor");
}
}, []);