@@ -16,6 +16,7 @@ module App =
16 open Crypto
16 open Crypto
17 open ApiClient
17 open ApiClient
18 open Buttons
18 open Buttons
20 // ── Domain Types ──
21 // ── Domain Types ──
@@ -273,8 +274,7 @@ module App =
273 Error = None
274 Error = None
274 PollStatus = "polling..."
275 PollStatus = "polling..."
275 FlushingOutbox = true },
276 FlushingOutbox = true },
276− [ CmdPoll(session, model.PollCursor)
277+ [ CmdPoll(session, model.PollCursor); CmdFlushOutbox session ]
277− CmdFlushOutbox session ]
278 | _ -> model, []
278 | _ -> model, []
280 | AuthErr err ->
280 | AuthErr err ->
@@ -320,9 +320,7 @@ module App =
320 model, []
320 model, []
322 match trySession model with
322 match trySession model with
324− { model with FlushingOutbox = true },
323+ | Some session -> { model with FlushingOutbox = true }, [ CmdFlushOutbox session ]
325− [ CmdFlushOutbox session ]
326 | None -> model, []
324 | None -> model, []
328 | FlushResult sent ->
326 | FlushResult sent ->
@@ -556,7 +554,10 @@ module App =
556 let x = (skBmp.Width - size) / 2
554 let x = (skBmp.Width - size) / 2
557 let y = (skBmp.Height - size) / 2
555 let y = (skBmp.Height - size) / 2
558 use cropped = new SkiaSharp.SKBitmap(size, size)
556 use cropped = new SkiaSharp.SKBitmap(size, size)
559− skBmp.ExtractSubset(cropped, SkiaSharp.SKRectI(x, y, x + size, y + size)) |> ignore
558+ skBmp.ExtractSubset(cropped, SkiaSharp.SKRectI(x, y, x + size, y + size))
560 use img = SkiaSharp.SKImage.FromBitmap(cropped)
561 use img = SkiaSharp.SKImage.FromBitmap(cropped)
561 use data = img.Encode(SkiaSharp.SKEncodedImageFormat.Png, 90)
562 use data = img.Encode(SkiaSharp.SKEncodedImageFormat.Png, 90)
562 data.ToArray()
563 data.ToArray()
@@ -630,7 +631,10 @@ module App =
630 | Some item ->
631 | Some item ->
632 let blob =
633 let blob =
635+ session.Identity.PrivKey
633− Crypto.encrypt session.Identity.PrivKey (Crypto.fromHex item.RecipientHex) item.EnvelopeJson
636+ (Crypto.fromHex item.RecipientHex)
635 let ts = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
639 let ts = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
636 do! sendMessage session.Url session.Token item.RecipientHex (Crypto.toHex blob) ts
640 do! sendMessage session.Url session.Token item.RecipientHex (Crypto.toHex blob) ts
@@ -640,8 +644,7 @@ module App =
640 log $"outbox send error: {ex.Message}"
644 log $"outbox send error: {ex.Message}"
641 do! Async.Sleep 3000
645 do! Async.Sleep 3000
642 dispatch (FlushResult true)
646 dispatch (FlushResult true)
644− dispatch (FlushResult false)
647+ | None -> dispatch (FlushResult false)
646 |> Async.Start)
649 |> Async.Start)
@@ -780,7 +783,7 @@ module App =
781 TextBlock("").height (50.)
784 TextBlock("").height (50.)
783− button "Next" GenIdentity
786+ button Primary "Next" GenIdentity
785 .margin(30.)
788 .margin(30.)
786 .centerVertical ()
789 .centerVertical ()
@@ -936,29 +939,37 @@ module App =
936 .margin (20.)
939 .margin (20.)
938 let private viewEditProfile model displayName bio (photo: byte[] option) =
941 let private viewEditProfile model displayName bio (photo: byte[] option) =
939− ScrollViewer(
942+ (Grid([], [ Dimension.Star; Dimension.Auto ]) {
940− (VStack(16.) {
944+ (VStack(16.) {
941− HStack(8.) {
945+ viewErrorBanner model.Error
942− Button("< Back", SetPage Settings)
943− TextBlock("Edit Profile").fontSize (20.)
946− viewErrorBanner model.Error
947+ imageButton photo DoPickPhoto
948− imageButton photo DoPickPhoto
949+ TextBlock("Name").fontFamily(Constants.fontFamily).fontWeight(FontWeight.Bold).margin (0, 24, 0, -8)
950+ (textField displayName (fun text -> SetPage(EditProfile(text, bio, photo)))).margin (0, 0, 0, 8)
950− TextBlock("Display Name:")
951− TextBox(displayName, fun text -> SetPage(EditProfile(text, bio, photo))).watermark ("Your name")
953− TextBlock("Bio:")
953+ TextBlock("Bio").fontFamily(Constants.fontFamily).fontWeight(FontWeight.Bold).margin (0, 0, 0, -8)
955− TextBox(bio, fun text -> SetPage(EditProfile(displayName, text, photo)))
955+ (multilineTextField bio (fun text -> SetPage(EditProfile(displayName, text, photo))))
956− .watermark ("Tell something about yourself")
956+ .margin (0, 0, 0, 8)
963+ Rectangle().stroke(SolidColorBrush(Colors.Black)).strokeThickness(4.).fill (Constants.accentColor)
966+ (button Secondary "back" (SetPage Settings)).margin (8.)
958− Button("Save Profile", DoSaveProfile).centerHorizontal ()
968+ (button Secondary "save" DoSaveProfile).margin (8.)
960− .margin (20.)
971+ .gridRow (1)
963 let private pageContent model =
974 let private pageContent model =
964 let page =
975 let page =