Просмотр исходного кода

fix: assets shoudn't create :file/path entities

file and db graphs don't create :file/path entities for asset files.
Import shouldn't be doing this. Part of LOG-2990
Gabriel Horner 2 лет назад
Родитель
Сommit
e64810087c
2 измененных файлов с 4 добавлено и 4 удалено
  1. 1 1
      src/main/frontend/components/imports.cljs
  2. 3 3
      src/main/frontend/fs/node.cljs

+ 1 - 1
src/main/frontend/components/imports.cljs

@@ -199,7 +199,7 @@
                                               parent-dir (path/path-join repo-dir (path/dirname (.-rpath file)))]
                                           (p/do!
                                            (fs/mkdir-if-not-exists parent-dir)
-                                           (fs/write-file! repo repo-dir (.-rpath file) content nil))))))))
+                                           (fs/write-file! repo repo-dir (.-rpath file) content {:skip-transact? true}))))))))
           (recur))
         true))))
 

+ 3 - 3
src/main/frontend/fs/node.cljs

@@ -19,7 +19,7 @@
     (p/resolved (= (string/trim disk-content) (string/trim db-content)))))
 
 (defn- write-file-impl!
-  [repo dir rpath content {:keys [ok-handler error-handler old-content skip-compare?]} stat]
+  [repo dir rpath content {:keys [ok-handler error-handler old-content skip-compare? skip-transact?]} stat]
   (let [file-fpath (path/path-join dir rpath)]
     (if skip-compare?
       (p/catch
@@ -55,8 +55,8 @@
                    mtime (gobj/get result "mtime")]
              (when-not contents-matched?
                (ipc/ipc "backupDbFile" (config/get-local-dir repo) rpath disk-content content))
-             (db/set-file-last-modified-at! repo rpath mtime)
-             (db/set-file-content! repo rpath content)
+             (when-not skip-transact? (db/set-file-last-modified-at! repo rpath mtime))
+             (when-not skip-transact? (db/set-file-content! repo rpath content))
              (when ok-handler
                (ok-handler repo rpath result))
              result)