                 :visibility visibility
                 :password password}
        :handler (fn [data]
-                  (if (= "error" (:status data))
-                    (swap! state assoc :message (keyword (:message data)))
+                  (if (and (= "error" (:status data)) (= (:message data) "page/Evidenceerror"))
+                    (swap! state assoc :message (keyword (:message data))
+                           :page {:id id
+                                  :tag tags
+                                  :password password
+                                  :visibility "public"})
                     (navigate-to next-url)
                     )
                   )})))

            [salava.core.i18n :refer [t]]
            [salava.core.helper :refer [dump]]
            [salava.page.ui.helper :as ph]))
;;fix, show error message!
(defn save-settings [state next-url]
  (let [{:keys [id tags visibility password]} (:page @state)]
    (reset! (cursor state [:message]) nil)

      [:div.form-group
       [:button {:class    "btn btn-primary"
                 :on-click #(do
                              (.preventDefault %)
                              (save-settings state (str "/page/preview/" id)))
                 :disabled (and (empty? @password-atom)
                                (= @visibility-atom "password"))}
        (t :page/Save)]]]]))
