Skip to content

Commit

Permalink
fix(desktop): Refresh loan list after saving a loan
Browse files Browse the repository at this point in the history
  • Loading branch information
VMelnalksnis committed Feb 10, 2024
1 parent 4df95cc commit 0e2e006
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ <h3>Fixed</h3>
Fixed desktop shortcut working directory in
<a href="https://github.com/VMelnalksnis/Gnomeshade/pull/1080">#1080</a>
</li>
<li>
Fixed loan list not refreshing after saving in
<a href="https://github.com/VMelnalksnis/Gnomeshade/pull/1081">#1081</a>
</li>
</ul>
</section>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,19 @@ public LoanViewModel(IActivityService activityService, IGnomeshadeClient gnomesh
_details = new(activityService, gnomeshadeClient, transactionId, null);

PropertyChanged += OnPropertyChanged;
_details.Upserted += DetailsOnUpserted;
}

/// <inheritdoc />
public override LoanUpsertionViewModel Details
{
get => _details;
set => SetAndNotify(ref _details, value);
set
{
_details.Upserted -= DetailsOnUpserted;
SetAndNotify(ref _details, value);
_details.Upserted += DetailsOnUpserted;
}
}

/// <inheritdoc />
Expand Down Expand Up @@ -92,4 +98,9 @@ private void OnPropertyChanged(object? sender, PropertyChangedEventArgs e)
OnPropertyChanged(nameof(Total));
}
}

private async void DetailsOnUpserted(object? sender, UpsertedEventArgs e)
{
await RefreshAsync();
}
}

0 comments on commit 0e2e006

Please sign in to comment.