diff --git a/src/main/frontend/components/page.cljs b/src/main/frontend/components/page.cljs index f429e3c30..da1c579dd 100644 --- a/src/main/frontend/components/page.cljs +++ b/src/main/frontend/components/page.cljs @@ -480,7 +480,7 @@ [:th (t :page/name)] [:th (t :file/last-modified-at)]]] [:tbody - (for [[page modified-at] pages] + (for [page pages] (let [encoded-page (util/encode-str page)] [:tr {:key encoded-page} [:td [:a {:on-click (fn [e] @@ -495,10 +495,7 @@ :href (rfe/href :page {:name encoded-page})} page]] [:td [:span.text-gray-500.text-sm - (if (zero? modified-at) - (t :file/no-data) - (date/get-date-time-string - (t/to-default-time-zone (tc/to-date-time modified-at))))]]]))]]))]))) + (t :file/no-data)]]]))]]))]))) (rum/defcs new < rum/reactive (rum/local "" ::title) diff --git a/src/main/frontend/config.cljs b/src/main/frontend/config.cljs index de191d74e..30c4b4f86 100644 --- a/src/main/frontend/config.cljs +++ b/src/main/frontend/config.cljs @@ -323,7 +323,11 @@ (defn get-file-path [repo-url relative-path] (if (and (util/electron?) (local-db? repo-url)) - (str (get-repo-dir repo-url) "/" relative-path) + (let [dir (get-repo-dir repo-url)] + (if (string/starts-with? relative-path dir) + relative-path + (str dir "/" + (string/replace relative-path #"^/" "")))) relative-path)) (defn get-config-path diff --git a/src/main/frontend/fs.cljs b/src/main/frontend/fs.cljs index 46ff13ea4..eaad06b0a 100644 --- a/src/main/frontend/fs.cljs +++ b/src/main/frontend/fs.cljs @@ -65,7 +65,7 @@ (-> (do (protocol/write-file! (get-fs dir) repo dir path content opts) - (db/set-file-last-modified-at! repo path (js/Date.))) + (db/set-file-last-modified-at! repo (config/get-file-path repo path) (js/Date.))) (p/catch (fn [error] (log/error :file/write-failed? {:dir dir :path path @@ -86,13 +86,7 @@ (defn stat [dir path] - (let [append-path (if path - (str "/" - (if (= \/ (first path)) - (subs path 1) - path)) - "")] - (protocol/stat (get-fs dir) dir path))) + (protocol/stat (get-fs dir) dir path)) (defn open-dir [ok-handler]