@@ -31,7 +31,7 @@ type Msg
3131 = Noop
3232 | RecieveMessage String
3333 | ShowLoginPage
34− | ShowError String
34+ | ShowError String String
3535 | ShowInfo String String
3636 | CloseNotification
3737 | SubmitLogin { email : String, password : String, server : String }
@@ -62,6 +62,7 @@ type Msg
6262 | FireGlobalEvent Event
6363 | GeneratePassword Bridge.PasswordGeneratorConfig
6464 | OpenNewCipherEditPage Bridge.CipherType
65+ | WrongPassword
6566
6667
6768type alias Model =
@@ -185,14 +186,14 @@ main =
185186subscriptions : Model -> Sub Msg
186187subscriptions model =
187188 Sub.batch
188− ([ getBridge ShowError
189+ ([ getBridge (ShowError "Something went wrong!")
189190 (\msg ->
190191 case msg of
191192 Bridge.NeedsLogin ->
192193 ShowLoginPage
193194
194195 Bridge.Error err ->
195− ShowError err
196+ ShowError "Something went wrong!" err
196197
197198 Bridge.LoadCiphers ciphers ->
198199 LoadCiphers ciphers
@@ -223,6 +224,9 @@ subscriptions model =
223224
224225 Bridge.GeneratedPassword password ->
225226 GlobalEvents.GeneratedPassword password |> FireGlobalEvent
227+
228+ Bridge.WrongPassword ->
229+ WrongPassword
226230 )
227231 ]
228232 ++ optional (List.isEmpty model.notifications |> not) (Time.every 1000 (\t -> ClearNotification { currentTime = t }))
@@ -306,9 +310,9 @@ update msg model =
306310 }
307311 model
308312
309− ShowError err ->
313+ ShowError title err ->
310314 appendNotification
311− { title = "Something went wrong"
315+ { title = title
312316 , message = err
313317 , severity = Notification.Error
314318 }
@@ -328,7 +332,7 @@ update msg model =
328332 )
329333
330334 SubmitLogin data ->
331− ( appendPageStack <| LoadingPage
335+ ( keepStackWith <| LoadingPage
332336 , FFI.sendBridge (Bridge.Login data)
333337 )
334338
@@ -589,6 +593,14 @@ update msg model =
589593 }
590594 |> Tuple.mapFirst (\pageModel -> keepStackWith <| EditCipherModel pageModel)
591595
596+ WrongPassword ->
597+ ( model
598+ , Cmd.batch
599+ [ pureCmd PopView
600+ , pureCmd (ShowError "Login failed" "The login details you provided are not valid. Please try again.")
601+ ]
602+ )
603+
592604
593605loginCallbacks : Login.Callbacks Msg
594606loginCallbacks =