mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-05-29 11:29:14 +00:00
Fix endless reload of login page
This commit is contained in:
parent
89a66ebe8c
commit
f55566388a
@ -125,7 +125,12 @@ updateWithSub msg model =
|
||||
else
|
||||
Cmd.batch
|
||||
[ Ports.removeAccount ()
|
||||
, Page.goto (Page.loginPage model.page)
|
||||
, case model.page of
|
||||
LoginPage _ ->
|
||||
Cmd.none
|
||||
|
||||
_ ->
|
||||
Page.goto (Page.loginPage model.page)
|
||||
]
|
||||
in
|
||||
( { model | flags = newFlags }, command, Sub.none )
|
||||
@ -134,7 +139,12 @@ updateWithSub msg model =
|
||||
( model
|
||||
, Cmd.batch
|
||||
[ Ports.removeAccount ()
|
||||
, Page.goto (Page.loginPage model.page)
|
||||
, case model.page of
|
||||
LoginPage _ ->
|
||||
Cmd.none
|
||||
|
||||
_ ->
|
||||
Page.goto (Page.loginPage model.page)
|
||||
]
|
||||
, Sub.none
|
||||
)
|
||||
|
@ -2,7 +2,6 @@ module Page.Login.Update exposing (update)
|
||||
|
||||
import Api
|
||||
import Api.Model.AuthResult exposing (AuthResult)
|
||||
import Api.Model.UserPass exposing (UserPass)
|
||||
import Data.Flags exposing (Flags)
|
||||
import Page exposing (Page(..))
|
||||
import Page.Login.Data exposing (..)
|
||||
@ -38,10 +37,16 @@ update referrer flags msg model =
|
||||
Maybe.withDefault HomePage referrer |> Page.goto
|
||||
in
|
||||
if lr.success then
|
||||
( { model | result = Just lr, password = "" }, Cmd.batch [ setAccount lr, gotoRef ], Just lr )
|
||||
( { model | result = Just lr, password = "" }
|
||||
, Cmd.batch [ setAccount lr, gotoRef ]
|
||||
, Just lr
|
||||
)
|
||||
|
||||
else
|
||||
( { model | result = Just lr, password = "" }, Ports.removeAccount (), Just lr )
|
||||
( { model | result = Just lr, password = "" }
|
||||
, Ports.removeAccount ()
|
||||
, Just lr
|
||||
)
|
||||
|
||||
AuthResp (Err err) ->
|
||||
let
|
||||
|
Loading…
x
Reference in New Issue
Block a user