on master help sign in
Store photos as binary, set up platform app icons, and implement smooth button animations
dbe902ciko
client/App.fs+73−73
@@ -25,7 +25,7 @@ module App =
25 | Chat of pubkey: string * compose: string
25 | Chat of pubkey: string * compose: string
26 | AddContact of pubkey: string * nickname: string
26 | AddContact of pubkey: string * nickname: string
27 | Settings
27 | Settings
28− | EditProfile of displayName: string * bio: string * photo: string
28+ | EditProfile of displayName: string * bio: string * photo: byte[]
29
29
30 type Session =
30 type Session =
31 { Url: string
31 { Url: string
@@ -83,7 +83,7 @@ module App =
83 | DismissError
83 | DismissError
84 | StateLoaded of Identity option * Data option * Profile option
84 | StateLoaded of Identity option * Data option * Profile option
85 | DoPickPhoto
85 | DoPickPhoto
86− | PhotoPicked of string
86+ | PhotoPicked of byte[]
87 | DoSaveProfile
87 | DoSaveProfile
88
88
89 // ── CmdMsg ──
89 // ── CmdMsg ──
@@ -156,13 +156,13 @@ module App =
156 Nickname = nickname
156 Nickname = nickname
157 DisplayName = ""
157 DisplayName = ""
158 Bio = ""
158 Bio = ""
159− PhotoBase64 = "" }
159+ Photo = [||] }
160
160
161 let private withProfile (p: Profile) (c: Contact) =
161 let private withProfile (p: Profile) (c: Contact) =
162 { c with
162 { c with
163 DisplayName = p.DisplayName
163 DisplayName = p.DisplayName
164 Bio = p.Bio
164 Bio = p.Bio
165− PhotoBase64 = p.PhotoBase64 }
165+ Photo = p.Photo }
166
166
167 let private applyEvent (m: Model) (evt: IncomingEvent) =
167 let private applyEvent (m: Model) (evt: IncomingEvent) =
168 match evt.Envelope with
168 match evt.Envelope with
@@ -242,7 +242,7 @@ module App =
242
242
243 { model with
243 { model with
244 Auth = Identified(identity, Offline)
244 Auth = Identified(identity, Offline)
245− Page = EditProfile("", "", "") },
245+ Page = EditProfile("", "", [||]) },
246 [ CmdSaveIdentity identity ]
246 [ CmdSaveIdentity identity ]
247
247
248 | SetServerUrl url -> { model with ServerUrl = url }, []
248 | SetServerUrl url -> { model with ServerUrl = url }, []
@@ -372,7 +372,7 @@ module App =
372 let profile: Profile =
372 let profile: Profile =
373 { DisplayName = name
373 { DisplayName = name
374 Bio = bio
374 Bio = bio
375− PhotoBase64 = photo }
375+ Photo = photo }
376
376
377 { model with
377 { model with
378 Profile = Some profile
378 Profile = Some profile
@@ -431,7 +431,7 @@ module App =
431 {| ``type`` = "profile"
431 {| ``type`` = "profile"
432 display_name = profile.DisplayName
432 display_name = profile.DisplayName
433 bio = profile.Bio
433 bio = profile.Bio
434− photo = profile.PhotoBase64 |}
434+ photo = Convert.ToBase64String profile.Photo |}
435 )
435 )
436
436
437 let private sendEnvelope (session: Session) (recipientHex: string) (envelope: Envelope) =
437 let private sendEnvelope (session: Session) (recipientHex: string) (envelope: Envelope) =
@@ -472,7 +472,7 @@ module App =
472 Envelope.ProfileMessage
472 Envelope.ProfileMessage
473 { DisplayName = displayName
473 { DisplayName = displayName
474 Bio = bio
474 Bio = bio
475− PhotoBase64 = photo }
475+ Photo = if photo = "" then [||] else Convert.FromBase64String photo }
476 )
476 )
477 | _ -> None
477 | _ -> None
478
478
@@ -510,9 +510,7 @@ module App =
510 | app ->
510 | app ->
511 match app.ApplicationLifetime with
511 match app.ApplicationLifetime with
512 | :? Avalonia.Controls.ApplicationLifetimes.IClassicDesktopStyleApplicationLifetime as desktop ->
512 | :? Avalonia.Controls.ApplicationLifetimes.IClassicDesktopStyleApplicationLifetime as desktop ->
513− desktop.MainWindow
514− |> Option.ofObj
515− |> Option.map (fun w -> w.StorageProvider)
513+ desktop.MainWindow |> Option.ofObj |> Option.map (fun w -> w.StorageProvider)
516 | _ -> None
514 | _ -> None
517
515
518 let mapCmd cmdMsg =
516 let mapCmd cmdMsg =
@@ -638,25 +636,31 @@ module App =
638 try
636 try
639 match getStorageProvider () with
637 match getStorageProvider () with
640 | Some sp ->
638 | Some sp ->
639+ let opts =
641− let opts = Avalonia.Platform.Storage.FilePickerOpenOptions(
640+ Avalonia.Platform.Storage.FilePickerOpenOptions(
642− AllowMultiple = false,
641+ AllowMultiple = false,
643− Title = "Pick Photo",
642+ Title = "Pick Photo",
644− FileTypeFilter = [
643+ FileTypeFilter =
645− Avalonia.Platform.Storage.FilePickerFileType("Images",
644+ [ Avalonia.Platform.Storage.FilePickerFileType(
645+ "Images",
646− Patterns = [ "*.png"; "*.jpg"; "*.jpeg"; "*.gif"; "*.bmp" ])
646+ Patterns = [ "*.png"; "*.jpg"; "*.jpeg"; "*.gif"; "*.bmp" ]
647+ ) ]
647− ])
648+ )
649+
648 let! files = sp.OpenFilePickerAsync(opts)
650 let! files = sp.OpenFilePickerAsync(opts)
651+
649 match files |> Seq.tryHead with
652 match files |> Seq.tryHead with
650− | None -> dispatch (PhotoPicked "")
653+ | None -> dispatch (PhotoPicked [||])
651 | Some file ->
654 | Some file ->
652 use! stream = file.OpenReadAsync()
655 use! stream = file.OpenReadAsync()
653 use ms = new MemoryStream()
656 use ms = new MemoryStream()
654 do! stream.CopyToAsync(ms)
657 do! stream.CopyToAsync(ms)
655− dispatch (PhotoPicked(Convert.ToBase64String(ms.ToArray())))
658+ dispatch (PhotoPicked(ms.ToArray()))
656− | None -> dispatch (PhotoPicked "")
659+ | None -> dispatch (PhotoPicked [||])
657 with _ ->
660 with _ ->
658− dispatch (PhotoPicked "")
661+ dispatch (PhotoPicked [||])
662+ }
659− } :> System.Threading.Tasks.Task)
663+ :> System.Threading.Tasks.Task)
660 |> ignore)
664 |> ignore)
661
665
662 | CmdSaveProfile profile -> Cmd.ofEffect (fun _ -> Store.saveProfile profile)
666 | CmdSaveProfile profile -> Cmd.ofEffect (fun _ -> Store.saveProfile profile)
@@ -667,7 +671,7 @@ module App =
667 VStack(4.) {
671 VStack(4.) {
668 match error with
672 match error with
669 | Some err ->
673 | Some err ->
670− TextBlock(err).foreground(SolidColorBrush(Colors.Red)).fontSize(12.)
674+ TextBlock(err).foreground(SolidColorBrush(Colors.Red)).fontSize (12.)
671 Button("Dismiss", DismissError)
675 Button("Dismiss", DismissError)
672 | None -> ()
676 | None -> ()
673 }
677 }
@@ -676,77 +680,73 @@ module App =
676 (VStack(24.) {
680 (VStack(24.) {
677 Image("avares://Skrepka/Assets/Images/logo.png", Avalonia.Media.Stretch.Uniform)
681 Image("avares://Skrepka/Assets/Images/logo.png", Avalonia.Media.Stretch.Uniform)
678 .margin(8., 0., 8., 0.)
682 .margin(8., 0., 8., 0.)
679− .maxWidth(300.)
683+ .maxWidth (300.)
680
684
681 TextBlock("Skrepka")
685 TextBlock("Skrepka")
682 .fontSize(32.)
686 .fontSize(32.)
683 .fontFamily(FontFamily("avares://Skrepka/Assets/Fonts#Unbounded"))
687 .fontFamily(FontFamily("avares://Skrepka/Assets/Fonts#Unbounded"))
684 .fontWeight(FontWeight.Bold)
688 .fontWeight(FontWeight.Bold)
685− .centerText()
689+ .centerText ()
686
690
687− TextBlock("").height(50.)
691+ TextBlock("").height (50.)
688
692
689 button "Next" GenIdentity
693 button "Next" GenIdentity
690 })
694 })
691 .margin(30.)
695 .margin(30.)
692− .centerVertical()
696+ .centerVertical ()
693
697
694 let private viewSettings model =
698 let private viewSettings model =
695 ScrollViewer(
699 ScrollViewer(
696 (VStack(16.) {
700 (VStack(16.) {
697− TextBlock("Settings")
701+ TextBlock("Settings").fontSize(24.).centerText ()
698− .fontSize(24.)
699− .centerText()
700
702
701 match model.Auth with
703 match model.Auth with
702 | Identified(id, conn) ->
704 | Identified(id, conn) ->
703 TextBlock("Your Public Key:")
705 TextBlock("Your Public Key:")
704
706
705− TextBlock(truncKey id.PubKeyHex).fontSize(14.)
707+ TextBlock(truncKey id.PubKeyHex).fontSize (14.)
706
708
707 Button("Copy Public Key", CopyPubKey)
709 Button("Copy Public Key", CopyPubKey)
708
710
709− TextBlock("Profile:").fontSize(18.)
711+ TextBlock("Profile:").fontSize (18.)
710
712
711 let displayName, bio, photo =
713 let displayName, bio, photo =
712 match model.Profile with
714 match model.Profile with
713− | Some p -> p.DisplayName, p.Bio, p.PhotoBase64
715+ | Some p -> p.DisplayName, p.Bio, p.Photo
714− | None -> "", "", ""
716+ | None -> "", "", [||]
715
717
716 if displayName <> "" then
718 if displayName <> "" then
717− TextBlock($"Name: {displayName}").fontSize(14.)
719+ TextBlock($"Name: {displayName}").fontSize (14.)
718
720
719 if bio <> "" then
721 if bio <> "" then
720− TextBlock($"Bio: {bio}")
721− .fontSize(14.)
722− .foreground(SolidColorBrush(Colors.DimGray))
722+ TextBlock($"Bio: {bio}").fontSize(14.).foreground (SolidColorBrush(Colors.DimGray))
723
723
724 Button("Edit Profile", SetPage(EditProfile(displayName, bio, photo)))
724 Button("Edit Profile", SetPage(EditProfile(displayName, bio, photo)))
725
725
726 TextBlock("Server:")
726 TextBlock("Server:")
727
727
728 match conn with
728 match conn with
729− | Online _ -> TextBlock(model.ServerUrl).fontSize(14.)
729+ | Online _ -> TextBlock(model.ServerUrl).fontSize (14.)
730 | _ -> TextBox(model.ServerUrl, SetServerUrl)
730 | _ -> TextBox(model.ServerUrl, SetServerUrl)
731
731
732 viewErrorBanner model.Error
732 viewErrorBanner model.Error
733
733
734 match conn with
734 match conn with
735 | Offline -> Button("Connect", DoConnect)
735 | Offline -> Button("Connect", DoConnect)
736− | Connecting -> TextBlock("Connecting...").centerText()
736+ | Connecting -> TextBlock("Connecting...").centerText ()
737 | Online _ ->
737 | Online _ ->
738 Button("Disconnect", DoDisconnect)
738 Button("Disconnect", DoDisconnect)
739 Button("Go to Conversations", SetPage Conversations)
739 Button("Go to Conversations", SetPage Conversations)
740 | NoIdentity -> ()
740 | NoIdentity -> ()
741 })
741 })
742− .margin(20.)
742+ .margin (20.)
743 )
743 )
744
744
745 let private viewConversations model =
745 let private viewConversations model =
746 ScrollViewer(
746 ScrollViewer(
747 (VStack(8.) {
747 (VStack(8.) {
748 HStack(8.) {
748 HStack(8.) {
749− TextBlock("Conversations").fontSize(24.)
749+ TextBlock("Conversations").fontSize (24.)
750
750
751 Button("+", SetPage(AddContact("", "")))
751 Button("+", SetPage(AddContact("", "")))
752 Button("Settings", SetPage Settings)
752 Button("Settings", SetPage Settings)
@@ -765,14 +765,14 @@ module App =
765
765
766 TextBlock($"{connStatusLabel model.Auth} [{pubPrefix}]{pollInfo}")
766 TextBlock($"{connStatusLabel model.Auth} [{pubPrefix}]{pollInfo}")
767 .fontSize(10.)
767 .fontSize(10.)
768− .foreground(SolidColorBrush(Colors.DimGray))
768+ .foreground (SolidColorBrush(Colors.DimGray))
769
769
770 viewErrorBanner model.Error
770 viewErrorBanner model.Error
771
771
772 if model.Contacts.IsEmpty then
772 if model.Contacts.IsEmpty then
773 TextBlock("No contacts yet. Tap + to add one.")
773 TextBlock("No contacts yet. Tap + to add one.")
774 .centerText()
774 .centerText()
775− .foreground(SolidColorBrush(Colors.Gray))
775+ .foreground (SolidColorBrush(Colors.Gray))
776
776
777 for c in model.Contacts.Values do
777 for c in model.Contacts.Values do
778 let preview =
778 let preview =
@@ -783,7 +783,7 @@ module App =
783
783
784 Button($"{contactName model.Contacts c.Pubkey}\n{preview}", SetPage(Chat(c.Pubkey, "")))
784 Button($"{contactName model.Contacts c.Pubkey}\n{preview}", SetPage(Chat(c.Pubkey, "")))
785 })
785 })
786− .margin(20.)
786+ .margin (20.)
787 )
787 )
788
788
789 let private viewChat model pk compose =
789 let private viewChat model pk compose =
@@ -794,7 +794,7 @@ module App =
794 HStack(8.) {
794 HStack(8.) {
795 Button("< Back", SetPage Conversations)
795 Button("< Back", SetPage Conversations)
796
796
797− TextBlock(name).fontSize(20.).centerVertical()
797+ TextBlock(name).fontSize(20.).centerVertical ()
798 }
798 }
799
799
800 viewErrorBanner model.Error
800 viewErrorBanner model.Error
@@ -802,7 +802,7 @@ module App =
802 ScrollViewer(
802 ScrollViewer(
803 VStack(4.) {
803 VStack(4.) {
804 if msgs.IsEmpty then
804 if msgs.IsEmpty then
805− TextBlock("No messages yet").padding(8.).fontSize(14.)
805+ TextBlock("No messages yet").padding(8.).fontSize (14.)
806 else
806 else
807 for m in msgs do
807 for m in msgs do
808 let prefix, tick =
808 let prefix, tick =
@@ -811,76 +811,74 @@ module App =
811 | Outgoing DeliveryStatus.Sent -> "You: ", ""
811 | Outgoing DeliveryStatus.Sent -> "You: ", ""
812 | Incoming -> "", ""
812 | Incoming -> "", ""
813
813
814− TextBlock($"{prefix}{m.Body}{tick}").padding(8.).fontSize(14.)
814+ TextBlock($"{prefix}{m.Body}{tick}").padding(8.).fontSize (14.)
815 }
815 }
816 )
816 )
817
817
818 HStack(8.) {
818 HStack(8.) {
819 TextBox(compose, fun text -> SetPage(Chat(pk, text)))
819 TextBox(compose, fun text -> SetPage(Chat(pk, text)))
820 .watermark("Message...")
820 .watermark("Message...")
821− .horizontalAlignment(Avalonia.Layout.HorizontalAlignment.Stretch)
821+ .horizontalAlignment (Avalonia.Layout.HorizontalAlignment.Stretch)
822
822
823 Button("Send", DoSend)
823 Button("Send", DoSend)
824 }
824 }
825 })
825 })
826− .margin(12.)
826+ .margin (12.)
827
827
828 let private viewAddContact model cpk cnn =
828 let private viewAddContact model cpk cnn =
829 (VStack(16.) {
829 (VStack(16.) {
830 HStack(8.) {
830 HStack(8.) {
831 Button("< Back", SetPage Conversations)
831 Button("< Back", SetPage Conversations)
832
832
833− TextBlock("Add Contact").fontSize(20.)
833+ TextBlock("Add Contact").fontSize (20.)
834 }
834 }
835
835
836 viewErrorBanner model.Error
836 viewErrorBanner model.Error
837
837
838 TextBlock("Public Key:")
838 TextBlock("Public Key:")
839− TextBox(cpk, fun text -> SetPage(AddContact(text, cnn))).watermark("sampel-palnet-...")
839+ TextBox(cpk, fun text -> SetPage(AddContact(text, cnn))).watermark ("sampel-palnet-...")
840
840
841 TextBlock("Nickname:")
841 TextBlock("Nickname:")
842 TextBox(cnn, fun text -> SetPage(AddContact(cpk, text)))
842 TextBox(cnn, fun text -> SetPage(AddContact(cpk, text)))
843
843
844− Button("Save Contact", DoSaveContact).centerHorizontal()
844+ Button("Save Contact", DoSaveContact).centerHorizontal ()
845 })
845 })
846− .margin(20.)
846+ .margin (20.)
847
847
848− let private viewEditProfile model displayName bio photo =
848+ let private viewEditProfile model displayName bio (photo: byte[]) =
849 ScrollViewer(
849 ScrollViewer(
850 (VStack(16.) {
850 (VStack(16.) {
851 HStack(8.) {
851 HStack(8.) {
852 Button("< Back", SetPage Settings)
852 Button("< Back", SetPage Settings)
853− TextBlock("Edit Profile").fontSize(20.)
853+ TextBlock("Edit Profile").fontSize (20.)
854 }
854 }
855
855
856 viewErrorBanner model.Error
856 viewErrorBanner model.Error
857
857
858− if photo <> "" then
858+ if photo.Length > 0 then
859 Image(
859 Image(
860− new Avalonia.Media.Imaging.Bitmap(new MemoryStream(Convert.FromBase64String(photo))),
860+ new Avalonia.Media.Imaging.Bitmap(new MemoryStream(photo: byte[])),
861− Avalonia.Media.Stretch.Uniform)
861+ Avalonia.Media.Stretch.Uniform
862+ )
862 .width(120.)
863 .width(120.)
863 .height(120.)
864 .height(120.)
864− .centerHorizontal()
865+ .centerHorizontal ()
865 else
866 else
866− TextBlock("No Photo")
867− .fontSize(16.)
868− .centerText()
869− .foreground(SolidColorBrush(Colors.Gray))
867+ TextBlock("No Photo").fontSize(16.).centerText().foreground (SolidColorBrush(Colors.Gray))
870
868
871− Button("Change Photo", DoPickPhoto).centerHorizontal()
869+ Button("Change Photo", DoPickPhoto).centerHorizontal ()
872
870
873 TextBlock("Display Name:")
871 TextBlock("Display Name:")
874− TextBox(displayName, fun text -> SetPage(EditProfile(text, bio, photo))).watermark("Your name")
872+ TextBox(displayName, fun text -> SetPage(EditProfile(text, bio, photo))).watermark ("Your name")
875
873
876 TextBlock("Bio:")
874 TextBlock("Bio:")
877
875
878 TextBox(bio, fun text -> SetPage(EditProfile(displayName, text, photo)))
876 TextBox(bio, fun text -> SetPage(EditProfile(displayName, text, photo)))
879− .watermark("Tell something about yourself")
877+ .watermark ("Tell something about yourself")
880
878
881− Button("Save Profile", DoSaveProfile).centerHorizontal()
879+ Button("Save Profile", DoSaveProfile).centerHorizontal ()
882 })
880 })
883− .margin(20.)
881+ .margin (20.)
884 )
882 )
885
883
886 let private pageContent model =
884 let private pageContent model =
@@ -893,7 +891,7 @@ module App =
893 | AddContact(pk, nn) -> AnyView(viewAddContact model pk nn)
891 | AddContact(pk, nn) -> AnyView(viewAddContact model pk nn)
894 | EditProfile(displayName, bio, photo) -> AnyView(viewEditProfile model displayName bio photo)
892 | EditProfile(displayName, bio, photo) -> AnyView(viewEditProfile model displayName bio photo)
895
893
896− Border(page).background(SolidColorBrush(Colors.White))
894+ Border(page).background (SolidColorBrush(Colors.White))
897
895
898 let view model =
896 let view model =
899#if MOBILE
897#if MOBILE
@@ -902,11 +900,13 @@ module App =
902 DesktopApplication() {
900 DesktopApplication() {
903 Window(pageContent model)
901 Window(pageContent model)
904 .title("Skrepka")
902 .title("Skrepka")
903+ .icon("avares://Skrepka/Assets/Images/logo.png")
905 .width(450.)
904 .width(450.)
906− .height(750.)
905+ .height (750.)
907 }
906 }
908#endif
907#endif
909
908
910 let program = Program.statefulWithCmdMsg init update mapCmd |> Program.withView view
909 let program = Program.statefulWithCmdMsg init update mapCmd |> Program.withView view
911
910
911+ let create () =
912− let create () = FabulousAppBuilder.Configure(FluentTheme, program)
912+ FabulousAppBuilder.Configure(FluentTheme, program)
client/Assets/Images/dotnet_bot.svgdeleted−93
@@ -1,93 +0,0 @@
1−<svg width="419" height="519" viewBox="0 0 419 519" fill="none" xmlns="http://www.w3.org/2000/svg">
2−<path d="M284.432 247.568L284.004 221.881C316.359 221.335 340.356 211.735 355.308 193.336C382.408 159.996 372.893 108.183 372.786 107.659L398.013 102.831C398.505 105.432 409.797 167.017 375.237 209.53C355.276 234.093 324.719 246.894 284.432 247.568Z" fill="#8A6FE8"/>
3−<path d="M331.954 109.36L361.826 134.245C367.145 138.676 375.055 137.959 379.497 132.639C383.928 127.32 383.211 119.41 377.891 114.969L348.019 90.0842C342.7 85.6531 334.79 86.3702 330.348 91.6896C325.917 97.0197 326.634 104.929 331.954 109.36Z" fill="#8A6FE8"/>
4−<path d="M407.175 118.062L417.92 94.2263C420.735 87.858 417.856 80.4087 411.488 77.5831C405.12 74.7682 397.67 77.6473 394.845 84.0156L383.831 108.461L407.175 118.062Z" fill="#8A6FE8"/>
5−<path d="M401.363 105.175L401.234 69.117C401.181 62.1493 395.498 56.541 388.53 56.5945C381.562 56.648 375.954 62.3313 376.007 69.2989L376.018 96.11L401.363 105.175Z" fill="#8A6FE8"/>
6−<path d="M386.453 109.071L378.137 73.9548C376.543 67.169 369.757 62.9628 362.971 64.5575C356.185 66.1523 351.979 72.938 353.574 79.7237L362.04 115.482L386.453 109.071Z" fill="#8A6FE8"/>
7−<path d="M381.776 142.261C396.359 142.261 408.181 130.44 408.181 115.857C408.181 101.274 396.359 89.4527 381.776 89.4527C367.194 89.4527 355.372 101.274 355.372 115.857C355.372 130.44 367.194 142.261 381.776 142.261Z" fill="url(#paint0_radial)"/>
8−<path d="M248.267 406.979C248.513 384.727 245.345 339.561 222.376 301.736L199.922 315.372C220.76 349.675 222.323 389.715 221.841 407.182C221.798 408.627 235.263 409.933 248.267 406.979Z" fill="url(#paint1_linear)"/>
9−<path d="M221.841 406.936L242.637 406.84L262.052 518.065L220.311 518.258C217.132 518.269 214.724 515.711 214.938 512.532L221.841 406.936Z" fill="#522CD5"/>
10−<path d="M306.566 488.814C310.173 491.661 310.109 495.782 309.831 500.127L308.964 513.452C308.803 515.839 306.727 517.798 304.34 517.809L260.832 518.012C258.125 518.023 256.08 515.839 256.262 513.142L256.551 499.335C256.883 494.315 255.192 492.474 251.307 487.744C244.649 479.663 224.967 435.62 226.84 406.925L248.256 406.829C249.691 423.858 272.167 461.682 306.566 488.814Z" fill="url(#paint2_linear)"/>
11−<path d="M309.82 500.127C310.023 497.088 310.077 494.176 308.889 491.715L254.635 491.961C256.134 494.166 256.765 496.092 256.562 499.314L256.273 513.121C256.091 515.828 258.146 518.012 260.843 517.99L304.34 517.798C306.727 517.787 308.803 515.828 308.964 513.442L309.82 500.127Z" fill="url(#paint3_radial)"/>
12−<path d="M133.552 407.471C133.103 385.22 135.864 340.021 158.49 301.993L181.073 315.425C160.545 349.921 159.346 389.972 159.989 407.428C160.042 408.884 146.578 410.318 133.552 407.471Z" fill="url(#paint4_linear)"/>
13−<path d="M110.798 497.152C110.765 494.187 111.204 491.575 112.457 487.23C131.882 434.132 133.52 407.364 133.52 407.364L159.999 407.246C159.999 407.246 161.819 433.512 181.716 486.427C183.289 490.195 183.471 493.641 183.674 496.831L183.792 513.816C183.803 516.374 181.716 518.483 179.158 518.494L177.873 518.504L116.781 518.782L115.496 518.793C112.927 518.804 110.83 516.728 110.819 514.159L110.798 497.152Z" fill="url(#paint5_linear)"/>
14−<path d="M110.798 497.152C110.798 496.67 110.808 496.199 110.83 495.739C110.969 494.262 111.643 492.603 114.875 492.582L180.207 492.282C182.561 492.367 183.343 494.176 183.589 495.311C183.621 495.814 183.664 496.328 183.696 496.82L183.813 513.806C183.824 515.411 183.011 516.824 181.769 517.669C181.031 518.172 180.132 518.472 179.179 518.483L177.895 518.494L116.802 518.772L115.528 518.782C114.244 518.793 113.077 518.269 112.232 517.434C111.386 516.599 110.862 515.432 110.851 514.148L110.798 497.152Z" fill="url(#paint6_radial)"/>
15−<path d="M314.979 246.348C324.162 210.407 318.008 181.777 318.008 181.777L326.452 181.734L326.656 181.574C314.262 115.75 256.326 66.0987 186.949 66.4198C108.796 66.773 45.7233 130.424 46.0765 208.577C46.4297 286.731 110.08 349.803 188.234 349.45C249.905 349.172 302.178 309.474 321.304 254.343C321.872 251.999 321.797 247.804 314.979 246.348Z" fill="url(#paint7_radial)"/>
16−<path d="M310.237 279.035L65.877 280.148C71.3998 289.428 77.95 298.012 85.3672 305.761L290.972 304.829C298.336 297.005 304.8 288.368 310.237 279.035Z" fill="#D8CFF7"/>
17−<path d="M235.062 312.794L280.924 312.585L280.74 272.021L234.877 272.23L235.062 312.794Z" fill="#512BD4"/>
18−<path d="M243.001 297.626C242.691 297.626 242.434 297.53 242.22 297.327C242.006 297.123 241.899 296.866 241.899 296.588C241.899 296.299 242.006 296.042 242.22 295.839C242.434 295.625 242.691 295.528 243.001 295.528C243.312 295.528 243.568 295.635 243.782 295.839C243.996 296.042 244.114 296.299 244.114 296.588C244.114 296.877 244.007 297.123 243.793 297.327C243.568 297.519 243.312 297.626 243.001 297.626Z" fill="white"/>
19−<path d="M255.192 297.434H253.212L247.967 289.203C247.839 289 247.721 288.775 247.636 288.55H247.593C247.636 288.786 247.657 289.299 247.657 290.091L247.668 297.444H245.912L245.891 286.228H247.999L253.062 294.265C253.276 294.597 253.415 294.833 253.479 294.95H253.511C253.458 294.651 253.437 294.148 253.437 293.441L253.426 286.217H255.17L255.192 297.434Z" fill="white"/>
20−<path d="M263.733 297.412L257.589 297.423L257.568 286.206L263.465 286.195V287.779L259.387 287.79L259.398 290.969L263.155 290.958V292.532L259.398 292.542L259.409 295.86L263.733 295.85V297.412Z" fill="white"/>
21−<path d="M272.445 287.758L269.298 287.769L269.32 297.401H267.5L267.479 287.769L264.343 287.779V286.195L272.434 286.174L272.445 287.758Z" fill="white"/>
22−<path d="M315.279 246.337C324.355 210.836 318.457 182.483 318.308 181.798L171.484 182.462C171.484 182.462 162.226 181.563 162.268 190.018C162.311 198.463 162.761 222.341 162.878 248.746C162.9 254.172 167.363 256.773 170.863 256.751C170.874 256.751 311.618 252.213 315.279 246.337Z" fill="url(#paint8_radial)"/>
23−<path d="M227.685 246.798C227.685 246.798 250.183 228.827 254.571 225.499C258.959 222.17 262.812 221.977 266.869 225.445C270.925 228.913 293.616 246.498 293.616 246.498L227.685 246.798Z" fill="#A08BE8"/>
24−<path d="M320.748 256.141C320.748 256.141 324.943 248.414 315.279 246.348C315.289 246.305 170.927 246.894 170.927 246.894C167.566 246.905 163.232 244.925 162.846 241.671C162.857 244.004 162.878 246.369 162.889 248.756C162.91 253.68 166.582 256.27 169.878 256.698C170.21 256.73 170.542 256.773 170.874 256.773L180.742 256.73L320.748 256.141Z" fill="#512BD4"/>
25−<path d="M206.4 233.214C212.511 233.095 217.302 224.667 217.102 214.39C216.901 204.112 211.785 195.878 205.674 195.997C199.563 196.116 194.772 204.544 194.973 214.821C195.173 225.099 200.289 233.333 206.4 233.214Z" fill="#512BD4"/>
26−<path d="M306.249 214.267C306.356 203.989 301.488 195.605 295.377 195.541C289.266 195.478 284.225 203.758 284.118 214.037C284.011 224.315 288.878 232.699 294.99 232.763C301.101 232.826 306.142 224.545 306.249 214.267Z" fill="#512BD4"/>
27−<path d="M205.905 205.291C208.152 203.022 211.192 202.016 214.157 202.262C215.912 205.495 217.014 209.733 217.111 214.389C217.164 217.3 216.811 220.04 216.158 222.513C212.669 223.519 208.752 222.662 205.979 219.922C201.912 215.909 201.88 209.348 205.905 205.291Z" fill="#8065E0"/>
28−<path d="M294.996 204.285C297.255 202.016 300.294 200.999 303.259 201.256C305.164 204.628 306.309 209.209 306.256 214.239C306.224 216.808 305.892 219.259 305.303 221.485C301.793 222.523 297.843 221.678 295.061 218.916C291.004 214.892 290.972 208.342 294.996 204.285Z" fill="#8065E0"/>
29−<path d="M11.6342 357.017C10.9171 354.716 -5.72611 300.141 21.3204 258.903C36.9468 235.078 63.3083 221.035 99.6664 217.15L102.449 243.276C74.3431 246.273 54.4676 256.345 43.3579 273.202C23.0971 303.941 36.5722 348.733 36.7113 349.183L11.6342 357.017Z" fill="url(#paint9_linear)"/>
30−<path d="M95.1498 252.802C109.502 252.802 121.137 241.167 121.137 226.815C121.137 212.463 109.502 200.828 95.1498 200.828C80.7976 200.828 69.1628 212.463 69.1628 226.815C69.1628 241.167 80.7976 252.802 95.1498 252.802Z" fill="url(#paint10_radial)"/>
31−<path d="M72.0098 334.434L33.4683 329.307C26.597 328.397 20.2929 333.214 19.3725 340.085C18.4627 346.956 23.279 353.26 30.1504 354.181L68.6919 359.308C75.5632 360.217 81.8673 355.401 82.7878 348.53C83.6975 341.658 78.8705 335.344 72.0098 334.434Z" fill="#8A6FE8"/>
32−<path d="M3.73535 367.185L7.35297 393.076C8.36975 399.968 14.7702 404.731 21.6629 403.725C28.5556 402.708 33.3185 396.308 32.3124 389.415L28.5984 362.861L3.73535 367.185Z" fill="#8A6FE8"/>
33−<path d="M15.5194 374.988L34.849 405.427C38.6058 411.292 46.4082 413.005 52.2735 409.248C58.1387 405.491 59.8512 397.689 56.0945 391.823L41.7953 369.144L15.5194 374.988Z" fill="#8A6FE8"/>
34−<path d="M26.0511 363.739L51.8026 389.019C56.7688 393.911 64.7532 393.846 69.6445 388.88C74.5358 383.914 74.4715 375.929 69.516 371.038L43.2937 345.297L26.0511 363.739Z" fill="#8A6FE8"/>
35−<path d="M26.4043 381.912C40.987 381.912 52.8086 370.091 52.8086 355.508C52.8086 340.925 40.987 329.104 26.4043 329.104C11.8216 329.104 0 340.925 0 355.508C0 370.091 11.8216 381.912 26.4043 381.912Z" fill="url(#paint11_radial)"/>
36−<path d="M184.73 63.6308L157.819 66.5892L158.561 38.5412L177.888 36.4178L184.73 63.6308Z" fill="#8A6FE8"/>
37−<path d="M170.018 41.647C180.455 39.521 187.193 29.3363 185.067 18.8988C182.941 8.46126 172.757 1.72345 162.319 3.84944C151.882 5.97543 145.144 16.1601 147.27 26.5976C149.396 37.0351 159.58 43.773 170.018 41.647Z" fill="#D8CFF7"/>
38−<path d="M196.885 79.385C198.102 79.2464 198.948 78.091 198.684 76.8997C195.851 64.2818 183.923 55.5375 170.773 56.9926C157.622 58.4371 147.886 69.5735 147.865 82.4995C147.863 83.7232 148.949 84.6597 150.168 84.5316L196.885 79.385Z" fill="url(#paint12_radial)"/>
39−<defs>
40−<radialGradient id="paint0_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(382.004 103.457) scale(26.4058)">
41−<stop stop-color="#8065E0"/>
42−<stop offset="1" stop-color="#512BD4"/>
43−</radialGradient>
44−<linearGradient id="paint1_linear" x1="214.439" y1="303.482" x2="236.702" y2="409.505" gradientUnits="userSpaceOnUse">
45−<stop stop-color="#522CD5"/>
46−<stop offset="0.4397" stop-color="#8A6FE8"/>
47−</linearGradient>
48−<linearGradient id="paint2_linear" x1="231.673" y1="404.144" x2="297.805" y2="522.048" gradientUnits="userSpaceOnUse">
49−<stop stop-color="#522CD5"/>
50−<stop offset="0.4397" stop-color="#8A6FE8"/>
51−</linearGradient>
52−<radialGradient id="paint3_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(280.957 469.555) rotate(-0.260742) scale(45.8326)">
53−<stop offset="0.034" stop-color="#522CD5"/>
54−<stop offset="0.9955" stop-color="#8A6FE8"/>
55−</radialGradient>
56−<linearGradient id="paint4_linear" x1="166.061" y1="303.491" x2="144.763" y2="409.709" gradientUnits="userSpaceOnUse">
57−<stop stop-color="#522CD5"/>
58−<stop offset="0.4397" stop-color="#8A6FE8"/>
59−</linearGradient>
60−<linearGradient id="paint5_linear" x1="146.739" y1="407.302" x2="147.246" y2="518.627" gradientUnits="userSpaceOnUse">
61−<stop stop-color="#522CD5"/>
62−<stop offset="0.4397" stop-color="#8A6FE8"/>
63−</linearGradient>
64−<radialGradient id="paint6_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(148.63 470.023) rotate(179.739) scale(50.2476)">
65−<stop offset="0.034" stop-color="#522CD5"/>
66−<stop offset="0.9955" stop-color="#8A6FE8"/>
67−</radialGradient>
68−<radialGradient id="paint7_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(219.219 153.929) rotate(179.739) scale(140.935)">
69−<stop offset="0.4744" stop-color="#A08BE8"/>
70−<stop offset="0.8618" stop-color="#8065E0"/>
71−</radialGradient>
72−<radialGradient id="paint8_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(314.861 158.738) rotate(179.739) scale(146.053)">
73−<stop offset="0.0933" stop-color="#E1DFDD"/>
74−<stop offset="0.6573" stop-color="white"/>
75−</radialGradient>
76−<linearGradient id="paint9_linear" x1="54.1846" y1="217.159" x2="54.1846" y2="357.022" gradientUnits="userSpaceOnUse">
77−<stop offset="0.3344" stop-color="#9780E6"/>
78−<stop offset="0.8488" stop-color="#8A6FE8"/>
79−</linearGradient>
80−<radialGradient id="paint10_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(90.3494 218.071) rotate(-0.260742) scale(25.9924)">
81−<stop stop-color="#8065E0"/>
82−<stop offset="1" stop-color="#512BD4"/>
83−</radialGradient>
84−<radialGradient id="paint11_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(25.805 345.043) scale(26.4106)">
85−<stop stop-color="#8065E0"/>
86−<stop offset="1" stop-color="#512BD4"/>
87−</radialGradient>
88−<radialGradient id="paint12_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(169.113 67.3662) rotate(-32.2025) scale(21.0773)">
89−<stop stop-color="#8065E0"/>
90−<stop offset="1" stop-color="#512BD4"/>
91−</radialGradient>
92−</defs>
93−</svg>
client/Assets/Images/user.svgnew file+1
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M320 312C386.3 312 440 258.3 440 192C440 125.7 386.3 72 320 72C253.7 72 200 125.7 200 192C200 258.3 253.7 312 320 312zM290.3 368C191.8 368 112 447.8 112 546.3C112 562.7 125.3 576 141.7 576L498.3 576C514.7 576 528 562.7 528 546.3C528 447.8 448.2 368 349.7 368L290.3 368z"/></svg>
client/Buttons.fs+35
@@ -9,8 +9,11 @@ open type Fabulous.Avalonia.View
9module Buttons =
9module Buttons =
10 open Avalonia.Media.Transformation
10 open Avalonia.Media.Transformation
11 open System
11 open System
12+ open Avalonia.Animation.Easings
12
13
13 let private animationDuration: int64 = 60
14 let private animationDuration: int64 = 60
15+ let private easing = CubicEaseOut()
16+
14
17
15 let private translate x y =
18 let private translate x y =
16 let b = TransformOperations.CreateBuilder 1
19 let b = TransformOperations.CreateBuilder 1
@@ -31,6 +34,7 @@ module Buttons =
31 Avalonia.Visual.RenderTransformProperty,
34 Avalonia.Visual.RenderTransformProperty,
32 TimeSpan.FromMilliseconds animationDuration
35 TimeSpan.FromMilliseconds animationDuration
33 )
36 )
37+ .easing (easing)
34 )
38 )
35
39
36 Rectangle().fill (SolidColorBrush(Constants.accentColor))
40 Rectangle().fill (SolidColorBrush(Constants.accentColor))
@@ -49,3 +53,34 @@ module Buttons =
49 .onPointerExited(fun _ -> pressed.Set false)
53 .onPointerExited(fun _ -> pressed.Set false)
50 .onTapped (fun _ -> msg)
54 .onTapped (fun _ -> msg)
51 }
55 }
56+
57+ let imageButton (img: byte[] option) (msg: 'msg) =
58+ Component(Option.defaultWith (fun _ -> "img") img) {
59+ let! pressed = Context.State(false)
60+ let offset = if pressed.Current then 4. else 8.
61+
62+ (Grid() {
63+ Rectangle()
64+ .fill(SolidColorBrush(Colors.Black))
65+ .renderTransform(translate offset offset)
66+ .transition (
67+ TransformOperationsTransition(
68+ Avalonia.Visual.RenderTransformProperty,
69+ TimeSpan.FromMilliseconds animationDuration
70+ )
71+ .easing (BackEaseOut())
72+ )
73+
74+ Rectangle().fill (SolidColorBrush(Constants.accentColor))
75+
76+ match img with
77+ | None -> Image("avares://Skrepka/Assets/Images/user.svg", Stretch.Uniform)
78+ | Some i -> Image(new Avalonia.Media.Imaging.Bitmap(new System.IO.MemoryStream(i)), Stretch.Uniform)
79+
80+ })
81+ .background(Brushes.Transparent)
82+ .onPointerPressed(fun _ -> pressed.Set true)
83+ .onPointerReleased(fun _ -> pressed.Set false)
84+ .onPointerExited(fun _ -> pressed.Set false)
85+ .onTapped (fun _ -> msg)
86+ }
client/Platform/Desktop/AppIcon.icnsnew file

Binary file not shown.

client/Platform/iOS/Info.plist+2
@@ -31,6 +31,8 @@
31 <string>UIInterfaceOrientationLandscapeLeft</string>
31 <string>UIInterfaceOrientationLandscapeLeft</string>
32 <string>UIInterfaceOrientationLandscapeRight</string>
32 <string>UIInterfaceOrientationLandscapeRight</string>
33 </array>
33 </array>
34+ <key>XSAppIconAssets</key>
35+ <string>Assets.xcassets/AppIcon.appiconset</string>
34 <key>UIStatusBarHidden</key>
36 <key>UIStatusBarHidden</key>
35 <true/>
37 <true/>
36 <key>UIViewControllerBasedStatusBarAppearance</key>
38 <key>UIViewControllerBasedStatusBarAppearance</key>
client/Platform/iOS/Resources/Assets.xcassets/AppIcon.appiconset/Contents.jsonnew file+23
@@ -0,0 +1,23 @@
1+{
2+ "images": [
3+ { "size": "20x20", "idiom": "iphone", "filename": "icon-40.png", "scale": "2x" },
4+ { "size": "20x20", "idiom": "iphone", "filename": "icon-60.png", "scale": "3x" },
5+ { "size": "29x29", "idiom": "iphone", "filename": "icon-58.png", "scale": "2x" },
6+ { "size": "29x29", "idiom": "iphone", "filename": "icon-87.png", "scale": "3x" },
7+ { "size": "40x40", "idiom": "iphone", "filename": "icon-80.png", "scale": "2x" },
8+ { "size": "40x40", "idiom": "iphone", "filename": "icon-120.png", "scale": "3x" },
9+ { "size": "60x60", "idiom": "iphone", "filename": "icon-120.png", "scale": "2x" },
10+ { "size": "60x60", "idiom": "iphone", "filename": "icon-180.png", "scale": "3x" },
11+ { "size": "20x20", "idiom": "ipad", "filename": "icon-20.png", "scale": "1x" },
12+ { "size": "20x20", "idiom": "ipad", "filename": "icon-40.png", "scale": "2x" },
13+ { "size": "29x29", "idiom": "ipad", "filename": "icon-29.png", "scale": "1x" },
14+ { "size": "29x29", "idiom": "ipad", "filename": "icon-58.png", "scale": "2x" },
15+ { "size": "40x40", "idiom": "ipad", "filename": "icon-40.png", "scale": "1x" },
16+ { "size": "40x40", "idiom": "ipad", "filename": "icon-80.png", "scale": "2x" },
17+ { "size": "76x76", "idiom": "ipad", "filename": "icon-76.png", "scale": "1x" },
18+ { "size": "76x76", "idiom": "ipad", "filename": "icon-152.png", "scale": "2x" },
19+ { "size": "83.5x83.5", "idiom": "ipad", "filename": "icon-167.png", "scale": "2x" },
20+ { "size": "1024x1024", "idiom": "ios-marketing", "filename": "icon-1024.png", "scale": "1x" }
21+ ],
22+ "info": { "version": 1, "author": "xcode" }
23+}
client/Platform/iOS/Resources/Assets.xcassets/AppIcon.appiconset/icon-1024.pngnew file

Binary file not shown.

client/Platform/iOS/Resources/Assets.xcassets/AppIcon.appiconset/icon-120.pngnew file

Binary file not shown.

client/Platform/iOS/Resources/Assets.xcassets/AppIcon.appiconset/icon-152.pngnew file

Binary file not shown.

client/Platform/iOS/Resources/Assets.xcassets/AppIcon.appiconset/icon-167.pngnew file

Binary file not shown.

client/Platform/iOS/Resources/Assets.xcassets/AppIcon.appiconset/icon-180.pngnew file

Binary file not shown.

client/Platform/iOS/Resources/Assets.xcassets/AppIcon.appiconset/icon-20.pngnew file

Binary file not shown.

client/Platform/iOS/Resources/Assets.xcassets/AppIcon.appiconset/icon-29.pngnew file

Binary file not shown.

client/Platform/iOS/Resources/Assets.xcassets/AppIcon.appiconset/icon-40.pngnew file

Binary file not shown.

client/Platform/iOS/Resources/Assets.xcassets/AppIcon.appiconset/icon-58.pngnew file

Binary file not shown.

client/Platform/iOS/Resources/Assets.xcassets/AppIcon.appiconset/icon-60.pngnew file

Binary file not shown.

client/Platform/iOS/Resources/Assets.xcassets/AppIcon.appiconset/icon-76.pngnew file

Binary file not shown.

client/Platform/iOS/Resources/Assets.xcassets/AppIcon.appiconset/icon-80.pngnew file

Binary file not shown.

client/Platform/iOS/Resources/Assets.xcassets/AppIcon.appiconset/icon-87.pngnew file

Binary file not shown.

client/Skrepka.fsproj+3
@@ -43,6 +43,7 @@
43
43
44 <ItemGroup Condition="$(AvaloniaPlatform) == 'Desktop'">
44 <ItemGroup Condition="$(AvaloniaPlatform) == 'Desktop'">
45 <Compile Include="$(DesktopPlatformFolder)Program.fs" />
45 <Compile Include="$(DesktopPlatformFolder)Program.fs" />
46+ <Content Include="$(DesktopPlatformFolder)AppIcon.icns" CopyToOutputDirectory="PreserveNewest" />
46 <PackageReference Include="Avalonia.Desktop" Version="11.3.0" />
47 <PackageReference Include="Avalonia.Desktop" Version="11.3.0" />
47 </ItemGroup>
48 </ItemGroup>
48
49
@@ -50,6 +51,8 @@
50 <None Include="$(iOSPlatformFolder)Entitlements.plist" />
51 <None Include="$(iOSPlatformFolder)Entitlements.plist" />
51 <None Include="$(iOSPlatformFolder)Info.plist" LogicalName="Info.plist" />
52 <None Include="$(iOSPlatformFolder)Info.plist" LogicalName="Info.plist" />
52 <InterfaceDefinition Include="$(iOSPlatformFolder)Resources\LaunchScreen.storyboard" />
53 <InterfaceDefinition Include="$(iOSPlatformFolder)Resources\LaunchScreen.storyboard" />
54+ <ImageAsset Include="$(iOSPlatformFolder)Resources\Assets.xcassets\AppIcon.appiconset\Contents.json" />
55+ <ImageAsset Include="$(iOSPlatformFolder)Resources\Assets.xcassets\AppIcon.appiconset\*.png" />
53 <Compile Include="$(iOSPlatformFolder)AppDelegate.fs" />
56 <Compile Include="$(iOSPlatformFolder)AppDelegate.fs" />
54 <PackageReference Include="Avalonia.iOS" Version="11.3.0" />
57 <PackageReference Include="Avalonia.iOS" Version="11.3.0" />
55 </ItemGroup>
58 </ItemGroup>
client/Store.fs+6−6
@@ -12,12 +12,12 @@ module Store =
12 Nickname: string
12 Nickname: string
13 DisplayName: string
13 DisplayName: string
14 Bio: string
14 Bio: string
15− PhotoBase64: string }
15+ Photo: byte[] }
16
16
17 type Profile =
17 type Profile =
18 { DisplayName: string
18 { DisplayName: string
19 Bio: string
19 Bio: string
20− PhotoBase64: string }
20+ Photo: byte[] }
21
21
22 [<RequireQualifiedAccess>]
22 [<RequireQualifiedAccess>]
23 type DeliveryStatus = Sent | Delivered
23 type DeliveryStatus = Sent | Delivered
@@ -56,7 +56,7 @@ module Store =
56 { [<BsonId>] Id: string
56 { [<BsonId>] Id: string
57 DisplayName: string
57 DisplayName: string
58 Bio: string
58 Bio: string
59− PhotoBase64: string }
59+ Photo: byte[] }
60
60
61 let private orEmpty s = s |> Option.ofObj |> Option.defaultValue ""
61 let private orEmpty s = s |> Option.ofObj |> Option.defaultValue ""
62
62
@@ -123,7 +123,7 @@ module Store =
123 |> Option.map (fun p ->
123 |> Option.map (fun p ->
124 { DisplayName = orEmpty p.DisplayName
124 { DisplayName = orEmpty p.DisplayName
125 Bio = orEmpty p.Bio
125 Bio = orEmpty p.Bio
126− PhotoBase64 = orEmpty p.PhotoBase64 })
126+ Photo = if p.Photo = null then [||] else p.Photo })
127 with _ -> None
127 with _ -> None
128
128
129 let saveProfile (profile: Profile) =
129 let saveProfile (profile: Profile) =
@@ -133,7 +133,7 @@ module Store =
133 { Id = "me"
133 { Id = "me"
134 DisplayName = profile.DisplayName
134 DisplayName = profile.DisplayName
135 Bio = profile.Bio
135 Bio = profile.Bio
136− PhotoBase64 = profile.PhotoBase64 }
136+ Photo = profile.Photo }
137 |> ignore
137 |> ignore
138 with _ -> ()
138 with _ -> ()
139
139
@@ -152,7 +152,7 @@ module Store =
152 { c with
152 { c with
153 DisplayName = orEmpty c.DisplayName
153 DisplayName = orEmpty c.DisplayName
154 Bio = orEmpty c.Bio
154 Bio = orEmpty c.Bio
155− PhotoBase64 = orEmpty c.PhotoBase64 })
155+ Photo = if c.Photo = null then [||] else c.Photo })
156 |> Map.ofSeq
156 |> Map.ofSeq
157
157
158 let messages =
158 let messages =