add capacitor-worker-repl

This commit is contained in:
Tienson Qin
2025-05-27 22:00:16 +08:00
parent 3813228aab
commit f29ed7b9d8
2 changed files with 18 additions and 9 deletions

View File

@@ -36,8 +36,16 @@
runtime-id (apply (if (= :old runtime-id-or-which) min max) runtime-ids)]
(worker-repl runtime-id)))))
(defn runtime-id-list
(defn capacitor-worker-repl
[]
(->> (api/repl-runtimes :app)
(when-let [runtime-id (->> (api/repl-runtimes :capacitor-new)
(filter (fn [runtime] (= :browser-worker (:host runtime))))
(map :client-id)
(apply max))]
(api/repl :capacitor-new {:runtime-id runtime-id})))
(defn runtime-id-list
[app]
(->> (api/repl-runtimes app)
(filter (fn [runtime] (= :browser-worker (:host runtime))))
(map :client-id)))

View File

@@ -229,13 +229,14 @@ independent of format as format specific heading characters are stripped"
(defn get-block-deep-last-open-child-id
[db db-id]
(loop [node (db-utils/entity db db-id)]
(if-let [last-child-id (get-block-last-direct-child-id db (:db/id node) true)]
(let [e (db-utils/entity db last-child-id)]
(if (or (:block/collapsed? e) (empty? (:block/_parent e)))
last-child-id
(recur e)))
nil)))
(when db
(loop [node (db-utils/entity db db-id)]
(if-let [last-child-id (get-block-last-direct-child-id db (:db/id node) true)]
(let [e (db-utils/entity db last-child-id)]
(if (or (:block/collapsed? e) (empty? (:block/_parent e)))
last-child-id
(recur e)))
nil))))
(def page? ldb/page?)