Skip to content

Commit

Permalink
Fix bug where updating a component's value in reload mode would not b…
Browse files Browse the repository at this point in the history
…e 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>
  • Loading branch information
freddyaboulton and gradio-pr-bot committed May 9, 2024
1 parent 22df61a commit 9ece050
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-chairs-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": patch
---

fix:Fix bug where updating a component's value in reload mode would not be shown in UI
2 changes: 2 additions & 0 deletions gradio/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ def reassign_context_keys(
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:
Expand Down

0 comments on commit 9ece050

Please sign in to comment.