Angular 19 + Even more bugfixes (#3675)

This commit is contained in:
Joe Milazzo 2025-03-25 16:43:41 -05:00 committed by GitHub
parent 535165c445
commit cc3ae7f472
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
249 changed files with 4400 additions and 4315 deletions

View file

@ -9,6 +9,8 @@ public static class OrderableHelper
{
public static void ReorderItems(List<AppUserDashboardStream> items, int itemId, int toPosition)
{
if (toPosition < 0) throw new ArgumentException("toPosition cannot be less than 0");
var item = items.Find(r => r.Id == itemId);
if (item != null)
{
@ -24,6 +26,8 @@ public static class OrderableHelper
public static void ReorderItems(List<AppUserSideNavStream> items, int itemId, int toPosition)
{
if (toPosition < 0) throw new ArgumentException("toPosition cannot be less than 0");
var item = items.Find(r => r.Id == itemId);
if (item != null && toPosition < items.Count)
{
@ -48,10 +52,15 @@ public static class OrderableHelper
public static void ReorderItems(List<ReadingListItem> items, int readingListItemId, int toPosition)
{
if (toPosition < 0) throw new ArgumentException("toPosition cannot be less than 0");
var item = items.Find(r => r.Id == readingListItemId);
if (item != null)
{
items.Remove(item);
// Ensure toPosition is within the new list bounds
toPosition = Math.Min(toPosition, items.Count);
items.Insert(toPosition, item);
}