Skip to content

Commit

Permalink
fix: using async void Task is more appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
cricketthomas committed Aug 2, 2024
1 parent ea13041 commit 7ef7ea0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions KeyVaultExplorer/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public static void CreateDesktopResources()
if (!dbPassExists)
DatabaseEncryptedPasswordManager.SetSecret($"keyvaultexplorer_{System.Guid.NewGuid().ToString()[..6]}");

Dispatcher.UIThread.Post(() =>
Dispatcher.UIThread.Post(async () =>
{
KvExplorerDb.OpenSqlConnection();
await KvExplorerDb.OpenSqlConnection();
if (!dbExists)
KvExplorerDb.InitializeDatabase();
Expand Down
2 changes: 1 addition & 1 deletion KeyVaultExplorer/Database/KvExplorerDb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public KvExplorerDb()
{
}

public static async void OpenSqlConnection()
public static async Task OpenSqlConnection()
{
string DataSource = Path.Combine(Constants.DatabaseFilePath);
var pass = await DatabaseEncryptedPasswordManager.GetSecret();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace KeyVaultExplorer.ViewModels;
public partial class CreateNewSecretVersionViewModel : ViewModelBase
{
[ObservableProperty]
public List<KvResourceGroupModel> resourceGroupItems;
private List<KvResourceGroupModel> resourceGroupItems;

private readonly AuthService _authService;

Expand Down Expand Up @@ -124,7 +124,7 @@ public async Task<ObservableCollection<SubscriptionDataItem>> GetAvailableSubscr
}

[RelayCommand]
public async Task NewVersion()
private async Task NewVersion()
{
var newSecret = new KeyVaultSecret(SecretName ?? KeyVaultSecretModel.Name, SecretValue);
if (KeyVaultSecretModel.NotBefore.HasValue)
Expand Down Expand Up @@ -153,7 +153,7 @@ partial void OnKeyVaultSecretModelChanging(SecretProperties value)


[RelayCommand]
public void SelectedSubscriptionChanged(SubscriptionDataItem value)
private void SelectedSubscriptionChanged(SubscriptionDataItem value)
{
if (value is not null && !_seenSubscriptions.Contains(value.Data.SubscriptionId))
{
Expand Down

0 comments on commit 7ef7ea0

Please sign in to comment.