Squash that async bug for good

This commit is contained in:
Alexander Horner
2022-12-06 23:31:11 +00:00
parent bba9051b4b
commit 76031ee868
2 changed files with 21 additions and 11 deletions

View File

@@ -47,13 +47,13 @@ namespace ntfysh_client
SaveTopicsToFile();
}
private void removeSelectedTopics_Click(object sender, EventArgs e)
private async void removeSelectedTopics_Click(object sender, EventArgs e)
{
while (notificationTopics.SelectedIndex > -1)
{
string topicUniqueString = (string)notificationTopics.Items[notificationTopics.SelectedIndex];
_notificationListener.UnsubscribeFromTopic(topicUniqueString);
await _notificationListener.UnsubscribeFromTopicAsync(topicUniqueString);
notificationTopics.Items.Remove(topicUniqueString);
}