From ff7c5f0b8957dafcb87dbacfd6faf4ac30ccf50c Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 26 Mar 2026 14:37:33 +0800 Subject: [PATCH] fix: notify error when decrypt failed --- src/main/frontend/handler/events.cljs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/frontend/handler/events.cljs b/src/main/frontend/handler/events.cljs index 0ba90c355b..80006f1743 100644 --- a/src/main/frontend/handler/events.cljs +++ b/src/main/frontend/handler/events.cljs @@ -56,6 +56,12 @@ (defmulti handle first) (defonce ^:private *search-index-build-timeout (atom nil)) +(def ^:private decrypt-aes-key-failed-notification + "Failed to decrypt this graph.") + +(defn- decrypt-aes-key-failed? + [error] + (string/includes? (or (ex-message error) (str error)) "decrypt-aes-key")) (defn- schedule-search-index-build! [repo] @@ -378,8 +384,8 @@ (println "RTC download graph failed, error:") (log/error :rtc-download-graph-failed e) (shui/popup-hide! :download-rtc-graph) - ;; TODO: notify error - )))) + (when (decrypt-aes-key-failed? e) + (notification/show! decrypt-aes-key-failed-notification :error false)))))) ;; db-worker -> UI (defmethod handle :db/sync-changes [[_ data]]