Browse Source

fix: raw file can't be edited

Tienson Qin 5 năm trước cách đây
mục cha
commit
01a7f0837e

+ 5 - 7
src/main/frontend/handler/draw.cljs

@@ -66,13 +66,11 @@
           (fs/write-file! repo repo-dir path data nil)
           (git-handler/git-add repo path)
           (ok-handler file)
-          (let [modified-at (tc/to-long (t/now))]
-            (db/transact! repo
-                          [{:file/path path
-                            :file/last-modified-at modified-at}
-                           {:page/name file
-                            :page/file path
-                            :page/journal? false}])))
+          (db/transact! repo
+            [{:file/path path}
+             {:page/name file
+              :page/file path
+              :page/journal? false}]))
          (p/catch (fn [error]
                     (prn "Write file failed, path: " path ", data: " data)
                     (js/console.dir error))))))))

+ 1 - 2
src/main/frontend/handler/file.cljs

@@ -158,8 +158,7 @@
                file-content)
           tx (concat tx [(let [t (tc/to-long (t/now))]
                            (cond->
-                            {:file/path file
-                             :file/last-modified-at t}
+                            {:file/path file}
                              new?
                              (assoc :file/created-at t)))])]
       (db/transact! repo-url tx))))