Fix bug where updating a component's value in reload mode would not be shown in UI (#8227)

* Update code

* add changeset

* lint

* Add code

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Freddy Boulton 2024-05-09 10:05:27 -04:00 committed by GitHub
parent 22df61a26a
commit 9ece050a70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
"gradio": patch
---
fix:Fix bug where updating a component's value in reload mode would not be shown in UI

View File

@ -312,6 +312,8 @@ def reassign_keys(old_blocks: Blocks, new_blocks: Blocks):
old_block.__class__ == new_block.__class__
and old_block is not None
and old_block.key not in assigned_keys
and json.dumps(getattr(old_block, "value", None))
== json.dumps(getattr(new_block, "value", None))
):
new_block.key = old_block.key
else: