Browse Source

chore(sync): clear code

rcmerci 3 years ago
parent
commit
250e2d241e
2 changed files with 5 additions and 10 deletions
  1. 2 2
      src/main/frontend/components/header.cljs
  2. 3 8
      src/main/frontend/fs/sync.cljs

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

@@ -119,8 +119,8 @@
             (map (fn [f] {:title f
                           :icon (ui/icon "arrow-narrow-down")}) downloading-files)
             (when sync-state
-              (map (fn [f] (:time f)
-                     {:title [:div [:div (:path f)] [:div.opacity-50 (util/time-ago (:time f))]]})
+              (map-indexed (fn [i f] (:time f)
+                     {:title [:div {:key i} [:div (:path f)] [:div.opacity-50 (util/time-ago (:time f))]]})
                    (take 10 (:history sync-state))))))
 
          (cond-> {}

+ 3 - 8
src/main/frontend/fs/sync.cljs

@@ -385,12 +385,6 @@
     (let [cause (ex-cause (<! (get-local-files-meta rsapi "" base-path file-paths)))]
       (assert (some? cause)))))
 
-(defn- local-file-exists? [base-path relative-path]
-  (go
-    (let [cause (ex-cause (<! (get-local-files-meta rsapi "" base-path relative-path)))]
-      (nil? cause))))
-
-
 (defn- retry-rsapi [f]
   (go-loop [n 3]
     (let [r (<! (f))]
@@ -672,7 +666,7 @@
 
   IPrintWithWriter
   (-pr-writer [_ w _opts]
-    (write-all w (str {:type type :base-path dir :path path}))))
+    (write-all w (str {:type type :base-path dir :path path :size (:size stat)}))))
 
 (defn- partition-file-change-events
   "return transducer.
@@ -765,7 +759,8 @@
                                                             (completing (fn [r i] (conj r (reverse i)))) ;reverse
                                                             '()
                                                             (reverse diff-txns))]
-                        (prn "partition-filetxns" partitioned-filetxns)
+                        ;; (prn "partition-filetxns" partitioned-filetxns)
+
                         ;; TODO: precheck etag
                         (if (empty? (flatten partitioned-filetxns))
                           (do (update-graphs-txid! latest-txid graph-uuid repo)