fix: can't delete remote graph

pull/11055/head
Tienson Qin 2024-03-26 14:49:40 +08:00
parent cf9131afa6
commit dd63079aa4
2 changed files with 6 additions and 8 deletions

View File

@ -65,10 +65,9 @@
[:div.controls
[:div.flex.flex-row.items-center
(let [current-repo (state/get-current-repo)
db-graph? (config/db-based-graph? current-repo)
manager? (and db-graph? (user-handler/manager? current-repo))]
(when-not (and db-graph? only-cloud? (not manager?))
(let [db-graph? (config/db-based-graph? url)
manager? (and db-graph? (user-handler/manager? url))]
(when-not (and only-cloud? (not manager?))
(ui/tippy {:html [:div.text-sm.max-w-xs
(cond
only-cloud?
@ -92,7 +91,7 @@
"")
unlink-or-remote-fn (fn []
(repo-handler/remove-repo! repo)
(state/pub-event! [:graph/unlinked repo current-repo]))
(state/pub-event! [:graph/unlinked repo (state/get-current-repo)]))
action-confirm-fn (if only-cloud?
(fn []
(when (or manager? (not db-graph?))

View File

@ -280,9 +280,8 @@
(defn get-user-type
[repo]
(when-let [uuid (ldb/get-graph-rtc-uuid (db/get-db repo))]
(-> (some #(when (= uuid (:GraphUUID %)) %) (:rtc/graphs @state/state))
:graph<->user-user-type)))
(-> (some #(when (= repo (:url %)) %) (:rtc/graphs @state/state))
:graph<->user-user-type))
(defn manager?
[repo]