enhance(plugin): suppress API rate-limit notices; replace loader

x
This commit is contained in:
charlie
2026-05-27 12:19:50 +08:00
parent cbf160656e
commit 9f596877e7
2 changed files with 8 additions and 6 deletions

View File

@@ -1668,7 +1668,7 @@
[:div
[:div (t :plugin/checking-for-updates)]
(when sub-content [:p.opacity-60 sub-content])]
(ui/loading ""))
:info)
(when uid (notification/clear! uid))))
[check-pending? sub-content])

View File

@@ -354,6 +354,7 @@
[(t :plugin/up-to-date ":)") :success]
[error-code :error])
rate-limit-error? (some-> msg str (string/includes? "API rate limit"))
pending? (seq (:plugin/updates-pending @state/state))]
(if (and only-check pending?)
@@ -365,11 +366,12 @@
(state/consume-updates-from-coming-plugin! payload true))
;; notify human tips
(notification/show!
(str
(if (= :error type) "[Error]" "")
"<" (:id payload) "> "
msg) type)))
(when-not rate-limit-error?
(notification/show!
(str
(if (= :error type) "[Error]" "")
"<" (:id payload) "> "
msg) type))))
(when-not fake-error?
(js/console.error "Update Error:" (:error-code payload))))