1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-23 03:33:59 +00:00

PM-3349 PM-3350 Refactored cipher bindings to have a simpler approach reusing a new CipherItemViewModel to avoid unwanted issues in the app

This commit is contained in:
Federico Maccaroni
2023-12-07 23:59:06 -03:00
parent 19c393842f
commit 5803635f44
18 changed files with 119 additions and 329 deletions

View File

@@ -1,13 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Bit.Core.Resources.Localization;
using Bit.Core.Abstractions;
using Bit.Core.Abstractions;
using Bit.Core.Enums;
using Bit.Core.Resources.Localization;
using Bit.Core.Utilities;
using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Pages
{
@@ -42,7 +36,7 @@ namespace Bit.App.Pages
if (ciphers?.Any() ?? false)
{
groupedItems.Add(
new GroupingsPageListGroup(ciphers.Select(c => new GroupingsPageListItem { Cipher = c }).ToList(),
new GroupingsPageListGroup(ciphers.Select(c => new CipherItemViewModel(c, WebsiteIconsEnabled)).ToList(),
AppResources.MatchingItems,
ciphers.Count,
false,
@@ -54,7 +48,7 @@ namespace Bit.App.Pages
protected override async Task SelectCipherAsync(IGroupingsPageListItem item)
{
if (!(item is GroupingsPageListItem listItem) || listItem.Cipher is null)
if (!(item is CipherItemViewModel listItem) || listItem.Cipher is null)
{
return;
}