Skip to content

Commit

Permalink
added unsubscribe button
Browse files Browse the repository at this point in the history
  • Loading branch information
GyroGearl00se committed Sep 14, 2024
1 parent abf6688 commit cdd3e0f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Components/Pages/Home.razor
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
<input @bind="subscribeTopic" name="subscribeTopic" autocomplete="on" placeholder="topic" />
</div>
<button class="btn btn-primary" @onclick="SubscribeToTopic">Subscribe</button>
<button class="btn btn-primary" @onclick="Unsubscribe">Unsubscribe</button>
</div>
</div>

Expand Down Expand Up @@ -231,7 +232,21 @@
toastService.ShowError($"Error starting Subscription: {ex.ErrorInfo}");
}



}

public void Unsubscribe()
{
try
{
SubscribeService.Disconnect();
toastService.ShowSuccess("Subscription stopped");
}
catch (SolaceSystems.Solclient.Messaging.OperationErrorException ex)
{
toastService.ShowError($"Error: {ex.ErrorInfo}");
}

}

public void Dispose()
Expand Down

0 comments on commit cdd3e0f

Please sign in to comment.