Browse Source

fix: ignored paths not working on web

Tienson Qin 3 years ago
parent
commit
1b04ea84da
2 changed files with 9 additions and 4 deletions
  1. 2 2
      src/main/frontend/components/header.cljs
  2. 7 2
      src/main/frontend/util/fs.cljs

+ 2 - 2
src/main/frontend/components/header.cljs

@@ -116,13 +116,13 @@
                   :title (t :discourse-title)
                   :target "_blank"}
         :icon (ui/icon "brand-discord")}
-       
+
        {:title [:div.flex-row.flex.justify-between.items-center
                 [:span (t :help/bug)]]
         :options {:href bug-report-url
                   :title "Fire a bug report on Github"
                   :target "_blank"}
-        :icon (ui/icon "bug")} 
+        :icon (ui/icon "bug")}
 
        (when (and (state/sub :auth/id-token) (user-handler/logged-in?))
          {:title (str (t :logout) " (" (user-handler/email) ")")

+ 7 - 2
src/main/frontend/util/fs.cljs

@@ -24,8 +24,13 @@
                  "logseq/version-files" "logseq/graphs-txid.edn"]]
     (when (string? path)
       (or
-       (some #(string/starts-with? path (str dir "/" %)) ignores)
-       (some #(string/includes? path (str "/" % "/")) ignores)
+       (some #(string/starts-with? path
+                                   (if (= dir "")
+                                     %
+                                     (str dir "/" %))) ignores)
+       (some #(string/includes? path (if (= dir "")
+                                       (str "/" % "/")
+                                       (str % "/"))) ignores)
        (some #(string/ends-with? path %)
              [".DS_Store" "logseq/graphs-txid.edn" "logseq/broken-config.edn"])
       ;; hidden directory or file