@@ -72,9 +72,6 @@ module App =
7272
7373 type Msg =
7474 | SetPage of Page
75− | SetCompose of string
76− | SetContactPubkey of string
77− | SetContactNickname of string
7875 | GenIdentity
7976 | SetServerUrl of string
8077 | DoConnect
@@ -89,8 +86,6 @@ module App =
8986 | CopyPubKey
9087 | DismissError
9188 | StateLoaded of StateLoadResult
92− | SetProfileDisplayName of string
93− | SetProfileBio of string
9489 | DoPickPhoto
9590 | PhotoPicked of string
9691 | DoSaveProfile
@@ -207,19 +202,6 @@ module App =
207202 match msg with
208203 | SetPage page -> { model with Page = page }, []
209204
210− | SetCompose text ->
211− match model.Page with
212− | Chat(pk, _) -> { model with Page = Chat(pk, text) }, []
213− | _ -> model, []
214− | SetContactPubkey pk ->
215− match model.Page with
216− | AddContact(_, nn) -> { model with Page = AddContact(pk, nn) }, []
217− | _ -> model, []
218− | SetContactNickname nn ->
219− match model.Page with
220− | AddContact(pk, _) -> { model with Page = AddContact(pk, nn) }, []
221− | _ -> model, []
222−
223205 | GenIdentity ->
224206 let identity = Crypto.generateIdentity ()
225207 { model with Auth = Identified(identity, Offline); Page = Settings },
@@ -310,16 +292,6 @@ module App =
310292
311293 | DismissError -> { model with Error = None }, []
312294
313− | SetProfileDisplayName name ->
314− match model.Page with
315− | EditProfile(_, bio, photo) -> { model with Page = EditProfile(name, bio, photo) }, []
316− | _ -> model, []
317−
318− | SetProfileBio bio ->
319− match model.Page with
320− | EditProfile(name, _, photo) -> { model with Page = EditProfile(name, bio, photo) }, []
321− | _ -> model, []
322−
323295 | DoPickPhoto -> model, [ CmdPickPhoto ]
324296
325297 | PhotoPicked photo ->
@@ -476,7 +448,7 @@ module App =
476448 | Message -> Some(decryptEvent session.Identity.PrivKey evt.Payload)
477449 | UnknownEvent _ -> None)
478450
479− let events = results |> Array.choose (function Ok e -> Some e | _ -> None) |> Array.toList
451+ let events = results |> Array.choose Result.toOption |> Array.toList
480452 let errors = results |> Array.choose (function Error e -> Some e | _ -> None) |> Array.toList
481453
482454 if not ackIds.IsEmpty then
@@ -690,7 +662,7 @@ module App =
690662 .font(size = 14.)
691663
692664 HStack(spacing = 8.) {
693− Entry(compose, SetCompose)
665+ Entry(compose, fun text -> SetPage(Chat(pk, text)))
694666 .placeholder("Message...")
695667
696668 Button("Send", DoSend)
@@ -712,11 +684,11 @@ module App =
712684 viewErrorBanner model.Error
713685
714686 Label("Public Key:")
715− Entry(cpk, SetContactPubkey)
687+ Entry(cpk, fun text -> SetPage(AddContact(text, cnn)))
716688 .placeholder("sampel-palnet-...")
717689
718690 Label("Nickname:")
719− Entry(cnn, SetContactNickname)
691+ Entry(cnn, fun text -> SetPage(AddContact(cpk, text)))
720692
721693 Button("Save Contact", DoSaveContact)
722694 .centerHorizontal()
@@ -749,11 +721,11 @@ module App =
749721 Button("Change Photo", DoPickPhoto).centerHorizontal()
750722
751723 Label("Display Name:")
752− Entry(displayName, SetProfileDisplayName)
724+ Entry(displayName, fun text -> SetPage(EditProfile(text, bio, photo)))
753725 .placeholder("Your name")
754726
755727 Label("Bio:")
756− Entry(bio, SetProfileBio)
728+ Entry(bio, fun text -> SetPage(EditProfile(displayName, text, photo)))
757729 .placeholder("Tell something about yourself")
758730
759731 Button("Save Profile", DoSaveProfile).centerHorizontal()