show error toast when failing to add to playlist

This commit is contained in:
Drew Weymouth
2025-01-05 16:38:36 -08:00
parent 24364c590d
commit 7c657accc1
4 changed files with 27 additions and 1 deletions
+9 -1
View File
@@ -39,9 +39,17 @@ func NewToastOverlay() *ToastOverlay {
}
func (t *ToastOverlay) ShowSuccessToast(message string) {
t.showToast(false, message)
}
func (t *ToastOverlay) ShowErrorToast(message string) {
t.showToast(true, message)
}
func (t *ToastOverlay) showToast(isErr bool, message string) {
t.cancelPreviousToast()
t.currentToast = newToast(false, message, t.dismissToast)
t.currentToast = newToast(isErr, message, t.dismissToast)
t.container.Objects = append(t.container.Objects, t.currentToast)
s := t.Size()