mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 19:06:21 +00:00
enhance(ux): catch component errors
This commit is contained in:
@@ -3166,10 +3166,15 @@
|
||||
(assoc config :container-id container-id)
|
||||
config)]
|
||||
(when (:block/uuid block)
|
||||
(rum/with-key
|
||||
(block-container-inner state repo config' block
|
||||
{:navigating-block navigating-block :navigated? navigated?})
|
||||
(str "block-inner" (:block/uuid block))))))
|
||||
(ui/catch-error
|
||||
(fn [^js error]
|
||||
[:div.flex.flex-col.pl-6.my-1
|
||||
[:code (str "#uuid\"" (:block/uuid block) "\"")]
|
||||
[:code.flex.p-1.text-red-rx-09 "Block render error: " (.-message error)]])
|
||||
(rum/with-key
|
||||
(block-container-inner state repo config' block
|
||||
{:navigating-block navigating-block :navigated? navigated?})
|
||||
(str "block-inner" (:block/uuid block)))))))
|
||||
|
||||
(defn divide-lists
|
||||
[[f & l]]
|
||||
|
||||
@@ -623,7 +623,7 @@
|
||||
{:on-click (fn []
|
||||
(handle-delete-property! block property {:class-schema? class-schema?})
|
||||
(shui/popup-hide!))}
|
||||
[:span.w-full.text-red-rx-07.hover:text-red-rx-09
|
||||
[:span.w-full.text-red-rx-09
|
||||
"Delete property"]))]
|
||||
{:as-dropdown? true
|
||||
:content-props {:class "w-48"}}))}
|
||||
|
||||
@@ -790,7 +790,7 @@
|
||||
(assoc state ::error error))}
|
||||
[{error ::error, c :rum/react-component} error-view view]
|
||||
(if (some? error)
|
||||
error-view
|
||||
(if (fn? error-view) (error-view error) error-view)
|
||||
view))
|
||||
|
||||
(rum/defcs catch-error-and-notify
|
||||
|
||||
Reference in New Issue
Block a user