Skip to content

Commit

Permalink
remove unnecessary delete! codes
Browse files Browse the repository at this point in the history
  • Loading branch information
llcc authored and tiensonqin committed Jun 30, 2022
1 parent df84e16 commit 314c3dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main/frontend/fs/capacitor_fs.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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 "\\" "_"))
Expand Down
10 changes: 2 additions & 8 deletions src/main/frontend/handler/page.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 314c3dd

Please sign in to comment.