Browse Source

enhance: set notification's timeout to 1500

Tienson Qin 4 years ago
parent
commit
537ff0727b

+ 6 - 5
src/main/frontend/handler/file.cljs

@@ -157,11 +157,12 @@
                    (p/let [delete-blocks (db/delete-file-blocks! repo-url file)
                            [pages blocks] (extract-handler/extract-blocks-pages repo-url file content utf8-content)
                            _ (when-let [current-file (page-exists-in-another-file (first pages) file)]
-                               (let [error (str "Page already exists with another file: " current-file)]
-                                 (state/pub-event! [:notification/show
-                                                    {:content error
-                                                     :status :error
-                                                     :clear? false}])))
+                               (when (not= file current-file)
+                                 (let [error (str "Page already exists with another file: " current-file ", current file: " file)]
+                                   (state/pub-event! [:notification/show
+                                                      {:content error
+                                                       :status :error
+                                                       :clear? false}]))))
                            blocks (remove-non-exists-refs! blocks)
                            block-ids (map (fn [block] {:block/uuid (:block/uuid block)}) blocks)
                            pages (extract-handler/with-ref-pages pages blocks)]

+ 1 - 1
src/main/frontend/handler/notification.cljs

@@ -24,6 +24,6 @@
                                                           :status status}))
 
      (when clear?
-       (js/setTimeout #(clear! uid) 3000))
+       (js/setTimeout #(clear! uid) 1500))
 
      uid)))