فهرست منبع

Merge branch 'master' into feat/db

Tienson Qin 2 سال پیش
والد
کامیت
b36d025097
2فایلهای تغییر یافته به همراه8 افزوده شده و 7 حذف شده
  1. 6 5
      src/main/frontend/fs/memory_fs.cljs
  2. 2 2
      src/main/frontend/ui.cljs

+ 6 - 5
src/main/frontend/fs/memory_fs.cljs

@@ -3,7 +3,6 @@
 
    Paths are denoted by `memory://`. No open-dir/get-files support."
   (:require [cljs-bean.core :as bean]
-            [frontend.db :as db]
             [frontend.fs.protocol :as protocol]
             [logseq.common.path :as path]
             [promesa.core :as p]))
@@ -52,10 +51,12 @@
       (let [fpath (path/url-to-path dir)]
         (-> (js/window.pfs.mkdir fpath)
             (p/catch (fn [error] (println "(memory-fs)Mkdir error: " error)))))))
-  (mkdir-recur! [this dir]
-    (p/let [parent (path/parent dir)
-            _ (when parent (<ensure-dir! parent))]
-      (protocol/mkdir! this dir)))
+  (mkdir-recur! [_this dir]
+    (when js/window.pfs
+      (let [fpath (path/url-to-path dir)]
+        (-> (js/window.pfs.mkdir fpath #js {:recursive true})
+            (p/catch (fn [error] (println "(memory-fs)Mkdir-recur error: " error)))))))
+
   (readdir [_this dir]
     (when js/window.pfs
       (let [fpath (path/url-to-path dir)]

+ 2 - 2
src/main/frontend/ui.cljs

@@ -1026,9 +1026,9 @@
 (def icon shui/icon)
 
 (rum/defc button-inner
-  [text & {:keys [background href class intent on-click small? title icon icon-props disabled? button-props]
+  [text & {:keys [background href class intent on-click small? icon icon-props disabled? button-props]
            :or   {small? false}
-           :as option}]
+           :as   option}]
   (let [opts {:text text
               :theme (when (contains? #{"link" "border-link"} intent) :text)
               :href href