mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #23479] [CLOSED] fix: reset loading state in PromptEditor submitHandler on error #66069
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23479
Author: @funsaized
Created: 4/7/2026
Status: ❌ Closed
Base:
dev← Head:fix/prompt-editor-loading-state-reset📝 Commits (10+)
fe6783cMerge pull request #19030 from open-webui/devfc05e0aMerge pull request #19405 from open-webui/deve3faec6Merge pull request #19416 from open-webui/dev9899293Merge pull request #19448 from open-webui/dev140605eMerge pull request #19462 from open-webui/dev6f1486fMerge pull request #19466 from open-webui/devd95f533Merge pull request #19729 from open-webui/deva7271530.6.43 (#20093)6adde20Merge pull request #20394 from open-webui/devf9b0534Merge pull request #20522 from open-webui/dev📊 Changes
1 file changed (+28 additions, -24 deletions)
View changed files
📝
src/lib/components/workspace/Prompts/PromptEditor.svelte(+28 -24)📄 Description
Summary
Fixes https://github.com/open-webui/open-webui/issues/23472
The
submitHandlerinPromptEditor.sveltesetsloading = truebefore callingawait onSubmit(...), but ifonSubmitthrows (e.g., network error, server error), execution exits the function andloading = falseis never reached. This leaves the Save button permanently disabled with no error feedback to the user.Changes
Wrapped the
onSubmitcall intry/catch/finally:catch: Shows an error toast viatoast.error(), matching the error handling pattern used throughout this file (setAsProduction,handleDeleteHistory,debouncedSaveMetadata)finally: Ensuresloading = falsealways executes, re-enabling the Save button regardless of success or failureBefore
If
onSubmit()rejects, the Save button stays disabled forever and the modal stays open with a spinner — no error feedback.After
On failure: error toast is shown, loading spinner stops, Save button is re-enabled so the user can retry.
Contributor License Agreement
By submitting my contributions to this repository in any form, I grant Open WebUI Inc. a perpetual, worldwide, irrevocable, royalty-free license, under copyright and patent, to use, modify, distribute, sublicense, and commercialize my work under any terms they choose, both now and in the future.
I represent that my contributions are my original work (or that I have sufficient rights to grant this license) and that I have the authority to enter into this agreement.
To the fullest extent permitted by law, my contributions are provided on an "as is" basis, with no warranties or guarantees of any kind, and I disclaim any liability for any issues or damages arising from their use or incorporation into the project, regardless of the type of legal claim.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.