 
 (defn handler [site-navi params]
   (let [user-id (:user-id params)
+        query-string (keywordize-keys (:query (url/url (-> js/window .-location .-href))))
+        init-values {:current-country  (or (:country query-string) (session/get-in [:user :country] "all"))
+                     :name-tag (or (:name-tag query-string) "")
+                     :issuer-name   (or (:issuer-name query-string) "")
+                     :order (or (:order query-string) "mtime")}
         badge_content_id (:badge_content_id params)
         state (atom {:value #{}
                      :user-id user-id
                      :badges []
                      :countries []
-                     :country-selected ""
+                     :country-selected  (or (:country query-string) (session/get-in [:user :country] "all"))
                      :advanced-search false
-                     :name-tag ""
-                     :recipient-name ""
-                     :issuer-name ""
-                     :order "mtime"
+                     :name-tag (or (:name-tag query-string) "")
+                     :issuer-name (or (:issuer-name query-string) "")
+                     :order  (or (:order query-string) "mtime")
                      :timer nil
                      :items #{}
                      :ajax-message nil})]
-    (init-data state)
+    (init-data state init-values)
     (fn []
       (if (session/get :user)
         (layout/default site-navi [content state badge_content_id])

            [clojure.string :as s]
            [komponentit.autocomplete :refer [multiple-autocomplete]]
            [schema.core :as sc]
            [salava.core.i18n :as i18n :refer [t]]))

;;Modal



                                        ;(if badge_content_id (open-modal badge_content_id true))
                                        )}))

(defn init-data [state {:keys [current-country name-tag issuer-name order]}]
  (ajax/GET
   (path-for "/obpv1/application/")
   {:params  {:country  (trim current-country)
              :name_tag (trim name-tag)
              :issuer   (trim issuer-name)
              :order    (trim order)}
    :handler (fn [data]
               (let [{:keys [applications countries user-country]} data]
                 (swap! state assoc :applications applications
                        :countries countries
                        )))}))


