Skip to content

Commit

Permalink
Potentially fixed crashes on Rules page due to an unnecessary paralle…
Browse files Browse the repository at this point in the history
…l initialization #165
  • Loading branch information
TheAxelander committed Oct 16, 2023
1 parent 6f2ec27 commit 0a5491b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 1.7.1 (2023-10-16)

* [Fixed] Potentially fixed crashes on Rules page due to an unnecessary parallel initialization [#165](https://github.com/TheAxelander/OpenBudgeteer/issues/165)

### 1.7 (2023-10-03)

* [Add] PostgreSQL support [#81](https://github.com/TheAxelander/OpenBudgeteer/issues/81) Thanks [csillaggyujto](https://github.com/csillaggyujto)
Expand Down
2 changes: 1 addition & 1 deletion OpenBudgeteer.Blazor/Shared/NavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<div class="col-md-auto">
<div class="navbar-text">
<span>
Version: 1.7 (<a href="https://github.com/TheAxelander/OpenBudgeteer/blob/master/CHANGELOG.md" target="_blank">Change Log</a>)
Version: 1.7.1 (<a href="https://github.com/TheAxelander/OpenBudgeteer/blob/master/CHANGELOG.md" target="_blank">Change Log</a>)
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,7 @@ public RuleSetViewModelItem(DbContextOptions<DatabaseContext> dbOptions)
Name = "No Selection"
});
using var dbContext = new DatabaseContext(_dbOptions);
AvailableBuckets.Add(dbContext.Bucket.First(i =>
i.BucketId == Guid.Parse("00000000-0000-0000-0000-000000000001")));
AvailableBuckets.Add(dbContext.Bucket.First(i =>
i.BucketId == Guid.Parse("00000000-0000-0000-0000-000000000002")));

var query = dbContext.Bucket
.Where(i =>
i.BucketId != Guid.Parse("00000000-0000-0000-0000-000000000001") &&
i.BucketId != Guid.Parse("00000000-0000-0000-0000-000000000002") &&
!i.IsInactive)
.OrderBy(i => i.Name);

foreach (var availableBucket in query.ToList())
foreach (var availableBucket in dbContext.Bucket.Where(i => !i.IsInactive).ToList())
{
AvailableBuckets.Add(availableBucket);
}
Expand Down
1 change: 0 additions & 1 deletion OpenBudgeteer.Core/ViewModels/RulesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public RulesViewModel(DbContextOptions<DatabaseContext> dbOptions)
{
_dbOptions = dbOptions;
RuleSets = new ObservableCollection<RuleSetViewModelItem>();
ResetNewRuleSet();
}

/// <summary>
Expand Down

0 comments on commit 0a5491b

Please sign in to comment.