This would be the code to remove a specific toast:
def remove_toast(self, toast: Toast) -> None:
"""
Remove a toast. If it is currently displayed, it will immediately disappear.
If it has been relegated to the action center, it will be removed from there.
"""
toastNotificationHistory = ToastNotificationManager.history
toastNotificationHistory.remove(toast.tag, toast.group, self._AUMID)
However, this only works if toast.group is a non-empty string. The question now is whether to set a default group (e.g. 'Toasts') on init of Toast, or try and figure out a workaround.
This would be the code to remove a specific toast:
However, this only works if toast.group is a non-empty string. The question now is whether to set a default group (e.g. 'Toasts') on init of Toast, or try and figure out a workaround.