mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 06:03:26 -05:00
[PR #23521] [CLOSED] fix: reset loading state in PromptEditor submitHandler on error #98272
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/23521
Author: @funsaized
Created: 4/8/2026
Status: ❌ Closed
Base:
dev← Head:fix/prompt-editor-clean📝 Commits (1)
f624d71fix: reset loading state in PromptEditor submitHandler on error📊 Changes
1 file changed (+32 additions, -28 deletions)
View changed files
📝
src/lib/components/workspace/Prompts/PromptEditor.svelte(+32 -28)📄 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.Changes
Wrapped the
onSubmitcall intry/catch/finally:catch: Shows an error toast viatoast.error(), matching the error handling pattern used throughout this file. Useserror instanceof Error ? error.message : $i18n.t('Failed to save prompt')to handle non-Error rejections cleanly.finally: Ensuresloading = falsealways executes, re-enabling the Save button regardless of outcome.Before
If
onSubmit()rejects, the Save button stays disabled forever with no error feedback.After
On failure: error toast shown, spinner stops, Save button 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.