diff --git a/frontend/src/uxbox/main.cljs b/frontend/src/uxbox/main.cljs index 860e0387f3..e128971e84 100644 --- a/frontend/src/uxbox/main.cljs +++ b/frontend/src/uxbox/main.cljs @@ -49,7 +49,7 @@ (and (:status error) (or (= (:status error) 403) (= (:status error) 419))) - (ts/schedule 100 #(st/emit! (logout))) + (ts/schedule 0 #(st/emit! (rt/nav :auth-login))) ;; Conflict (= status 412) diff --git a/frontend/src/uxbox/main/repo/images.cljs b/frontend/src/uxbox/main/repo/images.cljs index d646220cc2..c53a5a6661 100644 --- a/frontend/src/uxbox/main/repo/images.cljs +++ b/frontend/src/uxbox/main/repo/images.cljs @@ -55,12 +55,14 @@ [_ {:keys [collection id file width height mimetype] :as body}] (let [body (doto (js/FormData.) (.append "mimetype" mimetype) - (.append "collection" (str collection)) (.append "file" file) (.append "width" width) (.append "height" height) (.append "id" id)) - params {:url (str url "/library/images/") + _ (when collection + (.append body "collection" (str collection))) + + params {:url (str url "/library/images") :method :post :body body}] (send! params))) diff --git a/frontend/src/uxbox/main/ui.cljs b/frontend/src/uxbox/main/ui.cljs index 2dc81e07a6..2e7154c6f7 100644 --- a/frontend/src/uxbox/main/ui.cljs +++ b/frontend/src/uxbox/main/ui.cljs @@ -2,33 +2,34 @@ ;; License, v. 2.0. If a copy of the MPL was not distributed with this ;; file, You can obtain one at http://mozilla.org/MPL/2.0/. ;; -;; Copyright (c) 2015-2017 Andrey Antukh ;; Copyright (c) 2015-2017 Juan de la Cruz +;; Copyright (c) 2015-2019 Andrey Antukh (ns uxbox.main.ui - (:require [beicon.core :as rx] - [lentes.core :as l] - [cuerdas.core :as str] - [potok.core :as ptk] - [uxbox.builtins.icons :as i] - [uxbox.main.store :as st] - [uxbox.main.data.projects :as dp] - [uxbox.main.data.auth :refer [logout]] - [uxbox.main.ui.loader :refer [loader]] - [uxbox.main.ui.lightbox :refer [lightbox]] - [uxbox.main.ui.auth :as auth] - [uxbox.main.ui.dashboard :as dashboard] - [uxbox.main.ui.settings :as settings] - [uxbox.main.ui.workspace :refer [workspace]] - [uxbox.main.ui.shapes] - [uxbox.util.messages :as uum] - [uxbox.util.html-history :as html-history] - [uxbox.util.router :as rt] - [uxbox.util.timers :as ts] - [uxbox.util.i18n :refer [tr]] - [uxbox.util.data :refer [parse-int uuid-str?]] - [uxbox.util.dom :as dom] - [rumext.core :as mx :include-macros true])) + (:require + [beicon.core :as rx] + [cuerdas.core :as str] + [lentes.core :as l] + [potok.core :as ptk] + [rumext.core :as mx :include-macros true] + [uxbox.builtins.icons :as i] + [uxbox.main.data.auth :refer [logout]] + [uxbox.main.data.projects :as dp] + [uxbox.main.store :as st] + [uxbox.main.ui.auth :as auth] + [uxbox.main.ui.dashboard :as dashboard] + [uxbox.main.ui.lightbox :refer [lightbox]] + [uxbox.main.ui.loader :refer [loader]] + [uxbox.main.ui.settings :as settings] + [uxbox.main.ui.shapes] + [uxbox.main.ui.workspace :refer [workspace]] + [uxbox.util.data :refer [parse-int uuid-str?]] + [uxbox.util.dom :as dom] + [uxbox.util.html-history :as html-history] + [uxbox.util.i18n :refer [tr]] + [uxbox.util.messages :as uum] + [uxbox.util.router :as rt] + [uxbox.util.timers :as ts])) ;; --- Refs