Skip to content

Commit

Permalink
fix(mobile): invalid keyboard input for the create account pane form
Browse files Browse the repository at this point in the history
  • Loading branch information
xyhp915 authored and tiensonqin committed Jul 22, 2024
1 parent 4374741 commit c6affdb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/main/frontend/components/user/login.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[frontend.rum :refer [adapt-class]]
[frontend.modules.shortcut.core :as shortcut]
[frontend.handler.user :as user]
[frontend.handler.route :as route-handler]
[cljs-bean.core :as bean]
[frontend.handler.notification :as notification]
[frontend.state :as state]
Expand Down Expand Up @@ -41,7 +42,9 @@
(when session
(user/login-callback session)
(notification/show! (str "Hi, " username " :)") :success)
(state/close-modal!)))
(state/close-modal!)
(when (= :user-login (state/get-current-route))
(route-handler/redirect! {:to :home}))))
[])

nil))
Expand Down Expand Up @@ -72,15 +75,19 @@
user' (bean/->clj user)]
(user-pane sign-out! user')))))]))

(rum/defcs page <
(rum/defcs modal-inner <
shortcut/disable-all-shortcuts
[_state]
(page-impl))

(rum/defc page
[]
[:div.pt-10 (page-impl)])

(defn open-login-modal!
[]
(state/set-modal!
(fn [_close] (page))
(fn [_close] (modal-inner))
{:close-btn? true
:label "user-login"
:close-backdrop? false
Expand Down
4 changes: 3 additions & 1 deletion src/main/frontend/handler/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@
(defmethod handle :user/login [[_ host-ui?]]
(if (or host-ui? (not util/electron?))
(js/window.open config/LOGIN-URL)
(login/open-login-modal!)))
(if (mobile-util/native-platform?)
(route-handler/redirect! {:to :user-login})
(login/open-login-modal!))))

(defmethod handle :graph/added [[_ repo {:keys [empty-graph?]}]]
(db/set-key-value repo :ast/version db-schema/ast-version)
Expand Down

0 comments on commit c6affdb

Please sign in to comment.