Skip to content

Commit

Permalink
Merge pull request #1771 from pkuehnel/fix/restoredLocationBasedOnLas…
Browse files Browse the repository at this point in the history
…tTimestamp

fix(ConfigJsonService): restore is home from database based on last timestamp instead of Id
  • Loading branch information
pkuehnel authored Jan 24, 2025
2 parents 63ee2a0 + 7cf3872 commit d7d1f57
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ else
<div>
Hidden reason: @(error.HideReason == LoggedErrorHideReason.NotEnoughOccurrences ? "Not Enough occurrences" : "Dismissed")
</div>
<div>
<div style="word-break: break-word;">
@((MarkupString)error.Message)
</div>
</MudAlert>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ else
ShowCloseIcon="true"
CloseIconClicked="@(_ => DismissError(error.Id))">
<h4>@(error.Headline + $"{(error.HideOccurrenceCount ? string.Empty : $" occured {error.OccurrenceCount} time(s)")}")</h4>
@((MarkupString)error.Message)
<div style="word-break: break-word;">
@((MarkupString)error.Message)
</div>
</MudAlert>
</div>

Expand Down
2 changes: 1 addition & 1 deletion TeslaSolarCharger/Server/Services/ConfigJsonService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ private async Task<List<DtoCar>> GetCars()
var isHome = await teslaSolarChargerContext.CarValueLogs
.Where(c => c.CarId == car.Id
&& c.Type == CarValueType.LocatedAtHome)
.OrderByDescending(c => c.Id)
.OrderByDescending(c => c.Timestamp)
.Select(c => c.BooleanValue)
.FirstOrDefaultAsync().ConfigureAwait(false);
car.IsHomeGeofence = isHome;
Expand Down

0 comments on commit d7d1f57

Please sign in to comment.