From 256c6469a6de65e5583cec0c45118e5589b05d2b Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 5 Aug 2025 22:31:02 +0800 Subject: [PATCH] :bug: Fix the damn post loading --- DysonNetwork.Sphere/Post/PostService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DysonNetwork.Sphere/Post/PostService.cs b/DysonNetwork.Sphere/Post/PostService.cs index 1465ba8..987fa68 100644 --- a/DysonNetwork.Sphere/Post/PostService.cs +++ b/DysonNetwork.Sphere/Post/PostService.cs @@ -678,7 +678,8 @@ public partial class PostService( // Find the index of the poll embed first var pollIndex = embeds.FindIndex(e => - e.ContainsKey("Type") && ((JsonElement)e["Type"]).ToString() == "poll"); + e.ContainsKey("Type") && ((JsonElement)e["Type"]).ToString() == "poll" + ); if (pollIndex < 0) return; @@ -687,9 +688,10 @@ public partial class PostService( { var pollId = Guid.Parse(((JsonElement)pollEmbed["Id"]).ToString()); - var currentUserId = currentUser is not null ? Guid.Parse(currentUser.Id) : (Guid?)null; + Guid? currentUserId = currentUser is not null ? Guid.Parse(currentUser.Id) : null; var updatedPoll = await polls.LoadPollEmbed(pollId, currentUserId); embeds[pollIndex] = updatedPoll.ToDictionary(); + post.Meta["embeds"] = embeds; } catch (Exception ex) {