Skip to content

Commit

Permalink
Fix create tally crash (#382)
Browse files Browse the repository at this point in the history
* Crash resolve - create tally without dates

* #381 resolve list issues on create tally
  • Loading branch information
john-s-morgan committed Jul 19, 2023
1 parent 0a65ccc commit a1062ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/electionguard-ui/ElectionGuard.UI/ElectionGuard.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<ApplicationIdGuid>c0679a79-bc22-46ad-9c49-93de983e3fa2</ApplicationIdGuid>

<!-- Versions -->
<ApplicationDisplayVersion>1.90.0</ApplicationDisplayVersion>
<ApplicationVersion>2</ApplicationVersion>
<ApplicationDisplayVersion>1.90</ApplicationDisplayVersion>
<ApplicationVersion>5</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.3</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.19041.0</SupportedOSPlatformVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Maui.Core.Extensions;
using CommunityToolkit.Mvvm.Input;

namespace ElectionGuard.UI.ViewModels;

Expand Down Expand Up @@ -59,13 +60,13 @@ public partial class CreateTallyViewModel : BaseViewModel
private Manifest _currentManifest;

[ObservableProperty]
private List<string> _deviceList = new();
private ObservableCollection<string> _deviceList = new();

[ObservableProperty]
private List<string> _dateList = new();
private ObservableCollection<string> _dateList = new();

[ObservableProperty]
private List<BallotUpload> _ballotUploads = new();
private ObservableCollection<BallotUpload> _ballotUploads = new();

partial void OnElectionIdChanged(string value)
{
Expand All @@ -80,7 +81,7 @@ public partial class CreateTallyViewModel : BaseViewModel
_ = Shell.Current.CurrentPage.Dispatcher.Dispatch(async () =>
{
CurrentElection = currentElection!;
BallotUploads = uploads.DistinctBy(u => u.DeviceId).ToList();
BallotUploads = uploads.DistinctBy(u => u.DeviceId).ToObservableCollection();
CurrentManifest = new(record?.ManifestData);
CurrentKeyCeremony = await _keyCeremonyService.GetByKeyCeremonyIdAsync(CurrentElection.KeyCeremonyId!);
TallyName = $"{CurrentElection.Name} {AppResources.TallyText}";
Expand Down

0 comments on commit a1062ab

Please sign in to comment.