From 49c8418a1697e552bd940ee09ba493843165f2f7 Mon Sep 17 00:00:00 2001 From: Hans Nowak Date: Mon, 18 Sep 2023 14:23:30 +0200 Subject: [PATCH] fix typing issue? --- solara/website/pages/api/confirmation_dialog.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/solara/website/pages/api/confirmation_dialog.py b/solara/website/pages/api/confirmation_dialog.py index a9c43d578..2d271ed0a 100644 --- a/solara/website/pages/api/confirmation_dialog.py +++ b/solara/website/pages/api/confirmation_dialog.py @@ -3,12 +3,14 @@ """ +from typing import Union + import solara from solara.lab.components.confirmation_dialog import ConfirmationDialog from solara.website.utils import apidoc users = solara.reactive("Alice Bob Cindy Dirk Eve Fred".split()) -user_to_be_deleted = solara.reactive(users.value[0]) +user_to_be_deleted: solara.Reactive[Union[str, None]] = solara.reactive(users.value[0]) is_open = solara.reactive(False) @@ -21,9 +23,9 @@ def delete_user(): if user_to_be_deleted.value: users.set([u for u in users.value if u != user_to_be_deleted.value]) if users.value: - user_to_be_deleted.value = users.value[0] + user_to_be_deleted.set(users.value[0]) else: - user_to_be_deleted.value = None + user_to_be_deleted.set(None) @solara.component