mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-25 17:00:52 -04:00
fix: refresh the prompt editor after a version is set as production (#30233)
This commit is contained in:
@@ -181,9 +181,15 @@
|
||||
}
|
||||
|
||||
try {
|
||||
await setProductionPromptVersion(localStorage.token, prompt.id, historyEntry.id);
|
||||
const res = await setProductionPromptVersion(localStorage.token, prompt.id, historyEntry.id);
|
||||
// Update local prompt object to trigger reactivity
|
||||
prompt = { ...prompt, version_id: historyEntry.id };
|
||||
prompt = { ...prompt, ...(res ?? {}), version_id: historyEntry.id };
|
||||
|
||||
name = prompt.name || '';
|
||||
content = prompt.content ?? '';
|
||||
tags = (prompt.tags || []).map((tag) => ({ name: tag }));
|
||||
originalName = name;
|
||||
originalTags = tags;
|
||||
toast.success($i18n.t('Production version updated'));
|
||||
} catch (error) {
|
||||
toast.error(`${error}`);
|
||||
|
||||
Reference in New Issue
Block a user