Fix multiple trigger bug when function has js
Description
Closes: #9180
Changes the audio component so that multiple events are not triggered but also fixed the bigger issue that the app was not respecting trigger_mode if the function ran js
🎯 PRs Should Target Issues
Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.
Not adhering to this guideline will result in the PR being closed.
Tests
-
PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests:
bash scripts/run_all_tests.sh -
You may need to run the linters:
bash scripts/format_backend.shandbash scripts/format_frontend.sh
🪼 branch checks and previews
| • | Name | Status | URL |
|---|---|---|---|
| Spaces | Spaces preview | ||
| Storybook | Storybook preview | ||
| :unicorn: | Changes | Details |
Install Gradio from this PR
pip install https://gradio-pypi-previews.s3.amazonaws.com/ed55c2431db901592e3a9e9a3889d6cc7b57ecd2/gradio-4.42.0-py3-none-any.whl
Install Gradio Python Client from this PR
pip install "gradio-client @ git+https://github.com/gradio-app/gradio@ed55c2431db901592e3a9e9a3889d6cc7b57ecd2#subdirectory=client/python"
Install Gradio JS Client from this PR
npm install https://gradio-npm-previews.s3.amazonaws.com/ed55c2431db901592e3a9e9a3889d6cc7b57ecd2/gradio-client-1.5.1.tgz
🦄 change detected
This Pull Request includes changes to the following packages.
| Package | Version |
|---|---|
@gradio/audio |
patch |
@gradio/core |
patch |
gradio |
patch |
- [ ] Maintainers can select this checkbox to manually select packages to update.
With the following changelog entry.
Fix multiple trigger bug when function has js
Maintainers or the PR author can modify the PR title to modify this entry.
Something isn't right?
- Maintainers can change the version label to modify the version bump.
- If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.
Will go ahead and merge this one in for the release
@aliabid94 pnpm lint (or ts:check can't remember) complained that the function reached a max "complexity limit" if I just used an if statement to add the new code. So wrapped it into a function. Perhaps that function should be broken up a bit but didn't think it was necessary for this pr.
Thanks for the review!