a fork of iceshrimp.net but a tweaked frontend to my personal liking. waow
fediverse social-media social iceshrimp fedi
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[frontend] Fix crash with the emoji picker When viewing 2 or more emojis, and one has "Other" category while the second one has no category, the frontend will crash due to a duplicate key

Lunya 818e4882 fc461223

+12 -2
+6 -1
Iceshrimp.Frontend/Components/EmojiPicker.razor
··· 80 80 { 81 81 Categories = EmojiList 82 82 .Where(p => FilterName(p) || p.Tags.Count(a => a.Contains(EmojiFilter.StripLeadingTrailingSpaces())) != 0) 83 + .Select(p => 84 + { 85 + p.Category ??= Loc["Other"]; 86 + return p; 87 + }) 83 88 .OrderBy(p => p.Name) 84 89 .ThenBy(p => p.Id) 85 90 .GroupBy(p => p.Category) 86 91 .OrderBy(p => string.IsNullOrEmpty(p.Key)) 87 92 .ThenBy(p => p.Key) 88 - .ToDictionary(p => p.Key ?? Loc["Other"], p => p.ToList()); 93 + .ToDictionary(p => p.Key!, p => p.ToList()); 89 94 } 90 95 }
+6 -1
Iceshrimp.Frontend/Pages/Moderation/CustomEmojis.razor
··· 120 120 { 121 121 Categories = Emojis 122 122 .Where(p => p.Name.Contains(EmojiFilter.Trim()) || p.Tags.Count(a => a.Contains(EmojiFilter.Trim())) != 0) 123 + .Select(p => 124 + { 125 + p.Category ??= Loc["Other"]; 126 + return p; 127 + }) 123 128 .OrderBy(p => p.Name) 124 129 .ThenBy(p => p.Id) 125 130 .GroupBy(p => p.Category) 126 131 .OrderBy(p => string.IsNullOrEmpty(p.Key)) 127 132 .ThenBy(p => p.Key) 128 - .ToDictionary(p => p.Key ?? Loc["Other"], p => p.ToList()); 133 + .ToDictionary(p => p.Key!, p => p.ToList()); 129 134 StateHasChanged(); 130 135 } 131 136