From 20e4ff133c0b361d83805ae3b2fa3d9cf3985d7d Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Tue, 11 Jun 2024 02:49:32 +0800 Subject: [PATCH] fix: can't delete pages that have refs Also, redirect to home after deleting the page --- src/main/frontend/worker/handler/page.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/frontend/worker/handler/page.cljs b/src/main/frontend/worker/handler/page.cljs index 35010ce68e..989a6de677 100644 --- a/src/main/frontend/worker/handler/page.cljs +++ b/src/main/frontend/worker/handler/page.cljs @@ -222,7 +222,7 @@ (seq (ldb/get-block-property-values @conn (:block/uuid page))) {:msg "Page content deleted but unable to delete this page because blocks use this property"}) - (or (seq (:block/_refs page)) (contains? (:block/type page) "hidden")) + (contains? (:block/type page) "hidden") {:msg "Page content deleted but unable to delete this page because there are still references to it"}) (catch :default e @@ -273,7 +273,7 @@ (ldb/transact! conn tx-data (cond-> {:outliner-op :delete-page - :deleted-page page-name + :deleted-page (str (:block/uuid page)) :persist-op? persist-op?} rename? (assoc :real-outliner-op :rename-page)