                    :dangerouslySetInnerHTML {:__html "&times;"}
                    :on-click #(remove-tag tags-atom tag)}])])))
   ([tags-atom state reload-fn]
-   (let [save-settings (first (plugin-fun (session/get :plugins) "settings" "save_settings"))]
-     (into [:div.tag-labels]
-           (for [tag @tags-atom]
-             [:span {:class "label label-default"}
-              tag
-              [:a {:class "remove-tag"
-                   :dangerouslySetInnerHTML {:__html "&times;"}
-                   :on-click #(do
-                                (.preventDefault %)
-                                (remove-tag tags-atom tag)
-                                (save-settings state reload-fn "share"))}]])))))
+   (into [:div.tag-labels]
+         (for [tag @tags-atom]
+           [:span {:class "label label-default"}
+            tag
+            [:a {:class "remove-tag"
+                 :dangerouslySetInnerHTML {:__html "&times;"}
+                 :on-click #(do
+                              (.preventDefault %)
+                              (remove-tag tags-atom tag)
+                              (save-settings state))}]]))))

(ns salava.core.ui.tag
  (:require [clojure.string :refer [trim lower-case]]
            [salava.core.i18n :refer [t]]
            [salava.core.ui.helper :refer [plugin-fun]]
            [reagent.session :as session]))

(defn add-tag
  ([tags-atom new-tag-atom]

            :value       @new-tag-atom
            :on-change   #(reset! new-tag-atom (-> % .-target .-value))
            :on-key-down #(if (= (.-which %) 13)
                            (add-tag tags-atom new-tag-atom state))}]))

(defn tags
  ([tags-atom] (tags tags-atom true))
