fix when the chart is incomplete
MODIFY
WalletWasabi.Fluent/Helpers/EnumerableExtensions.cs
WalletWasabi.Fluent/Helpers/EnumerableExtensions.cs
@@ -21,7 +21,7 @@ namespace WalletWasabi.Fluent.Helpers
public static IEnumerable<(DateTimeOffset timestamp, TResult result)> SelectTimeSampleBackwards<TSource, TResult>(
this IEnumerable<TSource> sourceData,
Func<TSource, DateTimeOffset> timeSampler, Func<TSource, TResult> sampler,
- TimeSpan interval, DateTimeOffset endTime, DateTimeOffset? startFrom = default)
+ TimeSpan interval, DateTimeOffset endTime, TResult defaultValue, DateTimeOffset? startFrom = default)
{
var source = sourceData.ToArray();
@@ -44,16 +44,9 @@ namespace WalletWasabi.Fluent.Helpers
{
var current = source.FirstOrDefault(x => timeSampler(x) <= currentTime);
- if (current is { })
- {
- lastFound = (currentTime, sampler(current));
+ lastFound = current is { } ? (currentTime, sampler(current)) : (currentTime, defaultValue);
yield return lastFound;
- }
- else
- {
- yield break;
- }
currentTime -= interval;
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletBalanceChartTileViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletBalanceChartTileViewModel.cs
@@ -105,6 +105,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
x => x.Balance,
sampleTime,
sampleLimit,
+ 0,
DateTime.Now);
XValues.Clear();

fix when the chart is incomplete