mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-06 08:18:53 +00:00
fix(ui): add missing toast notifications for copying prompts
This commit is contained in:
parent
83526f1d60
commit
6d17fd3930
2 changed files with 5 additions and 3 deletions
|
|
@ -150,6 +150,7 @@
|
|||
const copyHandler = async (prompt) => {
|
||||
const res = await copyToClipboard(prompt.content);
|
||||
if (res) {
|
||||
toast.success($i18n.t('Copied to clipboard'));
|
||||
copiedId = prompt.command;
|
||||
setTimeout(() => {
|
||||
copiedId = null;
|
||||
|
|
|
|||
|
|
@ -158,6 +158,7 @@
|
|||
const textToCopy = selectedHistoryEntry?.snapshot?.content || content;
|
||||
const success = await copyToClipboard(textToCopy);
|
||||
if (success) {
|
||||
toast.success($i18n.t('Copied to clipboard'));
|
||||
contentCopied = true;
|
||||
setTimeout(() => {
|
||||
contentCopied = false;
|
||||
|
|
@ -426,9 +427,9 @@
|
|||
<Tooltip content={$i18n.t('Click to copy ID')}>
|
||||
<button
|
||||
class="text-xs text-gray-500 font-mono px-2 py-1 rounded-lg cursor-pointer hover:underline transition"
|
||||
on:click={() => {
|
||||
copyToClipboard(prompt.id);
|
||||
toast.success($i18n.t('ID copied to clipboard'));
|
||||
on:click={async () => {
|
||||
const res = await copyToClipboard(prompt.id);
|
||||
if (res) toast.success($i18n.t('Copied to clipboard'));
|
||||
}}
|
||||
>
|
||||
{prompt.id}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue