From 307adcb81d0b0f39d1b3312dd94166bb9acdcd53 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 20 Feb 2025 13:07:54 -0800 Subject: [PATCH] default back to title and desc, and replace brs with new lines --- reflex/components/sonner/toast.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/reflex/components/sonner/toast.py b/reflex/components/sonner/toast.py index 247b897b8..ce52a9ce6 100644 --- a/reflex/components/sonner/toast.py +++ b/reflex/components/sonner/toast.py @@ -278,7 +278,15 @@ class Toaster(Component): toast = ternary_operation( toast_ref.bool(), toast, - FunctionVar("window.alert").call(message), + FunctionVar("window.alert").call( + Var.create( + message + if isinstance(message, str) and message + else props.get("title", props.get("description", "")) + ) + .to(str) + .replace("
", "\n") + ), ) return run_script(toast)