fix(desktop): Desktop client cannot delete files #1346

pull/1073/head
charlie 2021-02-22 18:09:13 +08:00 committed by Tienson Qin
parent 12e23c932a
commit c54f4ba3a9
2 changed files with 4 additions and 4 deletions

View File

@ -278,7 +278,7 @@
[repo file]
(when-not (string/blank? file)
(->
(p/let [_ (git/remove-file repo file)
(p/let [_ (or (config/local-db? repo) (git/remove-file repo file))
result (fs/unlink! (config/get-repo-path repo file) nil)]
(when-let [file (db/entity repo [:file/path file])]
(common-handler/check-changed-files-status)
@ -291,7 +291,7 @@
(when (seq tx-data)
(db/transact! repo tx-data)))))
(p/catch (fn [err]
(prn "error: " err))))))
(js/console.error "error: " err))))))
(defn re-index!
[file]

View File

@ -278,12 +278,12 @@
(db/transact! tx-data)
;; remove file
(->
(p/let [_ (git/remove-file repo file-path)
(p/let [_ (or (config/local-db? repo) (git/remove-file repo file-path))
_ (fs/unlink! (config/get-repo-path repo file-path) nil)]
(common-handler/check-changed-files-status)
(repo-handler/push-if-auto-enabled! repo))
(p/catch (fn [err]
(prn "error: " err))))))
(js/console.error "error: " err))))))
(db/transact! [[:db.fn/retractEntity [:page/name page-name]]])