+ className="fixed inset-0 flex items-center justify-center bg-black/60 z-40 backdrop-blur-md animate-fadeIn">
diff --git a/lib/errors.ts b/lib/errors.ts
index cbf3024..6538023 100644
--- a/lib/errors.ts
+++ b/lib/errors.ts
@@ -1,14 +1,16 @@
/**
- * Clean error messages from Electron IPC prefix
- * Transforms: "Error invoking remote method 'channel': Error: Message"
- * Into: "Message"
+ * Extract user-facing error message from various error formats.
+ * Supports: Error objects, Tauri AppError { kind, message }, and plain strings.
*/
export function cleanErrorMessage(error: unknown): string {
if (error instanceof Error) {
- return error.message.replace(/^Error invoking remote method '[^']+': Error: /, '');
+ return error.message;
+ }
+ if (typeof error === 'object' && error !== null && 'message' in error) {
+ return String((error as { message: string }).message);
}
if (typeof error === 'string') {
- return error.replace(/^Error invoking remote method '[^']+': Error: /, '');
+ return error;
}
return 'An unknown error occurred';
}
diff --git a/src-tauri/src/crypto/key_manager.rs b/src-tauri/src/crypto/key_manager.rs
index d6a6192..d7b17cc 100644
--- a/src-tauri/src/crypto/key_manager.rs
+++ b/src-tauri/src/crypto/key_manager.rs
@@ -165,3 +165,7 @@ pub fn get_last_user_id() -> AppResult