mirror of
https://github.com/logseq/logseq.git
synced 2026-05-24 12:44:22 +00:00
debug: collect insert block timeout errors
This commit is contained in:
@@ -353,13 +353,19 @@
|
||||
:block/name (util/page-name-sanity-lc (:block/title new-block)))
|
||||
(dissoc :block/page)))
|
||||
new-block)]
|
||||
(ui-outliner-tx/transact!
|
||||
{:outliner-op :insert-blocks}
|
||||
(save-current-block! {:current-block current-block})
|
||||
(outliner-op/insert-blocks! [new-block'] current-block {:sibling? sibling?
|
||||
:keep-uuid? keep-uuid?
|
||||
:ordered-list? ordered-list?
|
||||
:replace-empty-target? replace-empty-target?}))))
|
||||
(->
|
||||
(ui-outliner-tx/transact!
|
||||
{:outliner-op :insert-blocks}
|
||||
(save-current-block! {:current-block current-block})
|
||||
(outliner-op/insert-blocks! [new-block'] current-block {:sibling? sibling?
|
||||
:keep-uuid? keep-uuid?
|
||||
:ordered-list? ordered-list?
|
||||
:replace-empty-target? replace-empty-target?}))
|
||||
(p/timeout 2000)
|
||||
(p/catch (fn [error]
|
||||
(js/console.error error)
|
||||
(state/pub-event! [:capture-error {:error error
|
||||
:payload {:type :insert-block-timeout}}]))))))
|
||||
|
||||
(defn- block-self-alone-when-insert?
|
||||
[config uuid]
|
||||
|
||||
@@ -64,7 +64,6 @@
|
||||
"NOTE: don't add more logic in this listener, use mobile-flows instead"
|
||||
[^js state]
|
||||
(println :debug :app-state-change-handler state (js/Date.))
|
||||
(reset! mobile-flows/*mobile-app-state (.-isActive state))
|
||||
(when (state/get-current-repo)
|
||||
(let [is-active? (.-isActive state)]
|
||||
(if (not is-active?)
|
||||
@@ -79,7 +78,8 @@
|
||||
500)
|
||||
(p/catch (fn [error]
|
||||
(js/console.error error)
|
||||
(js/window.location.reload)))))))))
|
||||
(js/window.location.reload))))))))
|
||||
(reset! mobile-flows/*mobile-app-state (.-isActive state)))
|
||||
|
||||
(defn- general-init
|
||||
"Initialize event listeners used by both iOS and Android"
|
||||
|
||||
Reference in New Issue
Block a user