mirror of
https://github.com/logseq/logseq.git
synced 2026-05-23 12:14:06 +00:00
remove unnecessary delete! codes
This commit is contained in:
@@ -271,7 +271,7 @@
|
||||
(unlink! [this repo path _opts]
|
||||
(p/let [path (get-file-path nil path)
|
||||
repo-dir (config/get-local-dir repo)
|
||||
recycle-dir (str repo-dir config/app-name "/recycle")
|
||||
recycle-dir (str repo-dir config/app-name "/.recycle")
|
||||
file-name (-> (string/replace path repo-dir "")
|
||||
(string/replace "/" "_")
|
||||
(string/replace "\\" "_"))
|
||||
|
||||
@@ -175,14 +175,8 @@
|
||||
(when-not (string/blank? file-path)
|
||||
(db/transact! [[:db.fn/retractEntity [:file/path file-path]]])
|
||||
(when unlink-file?
|
||||
(->
|
||||
(p/let [_ (and (config/local-db? repo)
|
||||
(mobile-util/native-platform?)
|
||||
;; TODO: @leizhe remove fs/delete-file! and use fs/unlink!
|
||||
(fs/delete-file! repo file-path file-path {}))
|
||||
_ (fs/unlink! repo (config/get-repo-path repo file-path) nil)])
|
||||
(p/catch (fn [err]
|
||||
(js/console.error "error: " err))))))))
|
||||
(-> (fs/unlink! repo (config/get-repo-path repo file-path) nil)
|
||||
(p/catch (fn [error] (js/console.error error))))))))
|
||||
|
||||
(defn- compute-new-file-path
|
||||
[old-path new-name]
|
||||
|
||||
Reference in New Issue
Block a user