Skip to content

Commit

Permalink
Always choose max id + 1 as the next id
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseBritto committed Dec 11, 2023
1 parent f156cdf commit 254d07e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion NickvisionMoney.Shared/Models/Account.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,10 @@ public async Task<bool> DeleteTransactionAsync(uint id)
Transactions.Remove(id);
if (id + 1 == NextAvailableTransactionId)
{
NextAvailableTransactionId--;
if(Transactions.Count == 0)
NextAvailableTransactionId = 1;
else
NextAvailableTransactionId = Transactions.Max(x => x.Key) + 1;
}
BackupAccountToCSV();
return true;
Expand Down

0 comments on commit 254d07e

Please sign in to comment.