Browse Source

fix: page ref disappears after adding #Page to template tags

Tienson Qin 7 months ago
parent
commit
27cd21436f

+ 2 - 1
src/main/frontend/components/views.cljs

@@ -1482,7 +1482,8 @@
                            ""))
             result (editor-handler/api-insert-new-block! view-title
                                                          {:page (:block/uuid page)
-                                                          :properties properties})]
+                                                          :properties properties
+                                                          :edit-block? false})]
       (db/entity [:block/uuid (:block/uuid result)]))))
 
 (rum/defc views-tab < rum/reactive db-mixins/query

+ 5 - 5
src/main/frontend/handler/common/page.cljs

@@ -73,11 +73,11 @@
                            (outliner-op/create-page! title' options'))
                    [_page-name page-uuid] (ldb/read-transit-str result)]
              (when redirect?
-               (route-handler/redirect-to-page! page-uuid))
-             (let [page (db/get-page (or page-uuid title'))]
-               (when-let [first-block (ldb/get-first-child @conn (:db/id page))]
-                 (block-handler/edit-block! first-block :max {:container-id :unknown-container}))
-               page))))))))
+               (route-handler/redirect-to-page! page-uuid)
+               (let [page (db/get-page (or page-uuid title'))]
+                 (when-let [first-block (ldb/get-first-child @conn (:db/id page))]
+                   (block-handler/edit-block! first-block :max {:container-id :unknown-container}))
+                 page)))))))))
 
 ;; favorite fns
 ;; ============