forked from open-webui/open-webui
refac: copy to clipboard message
This commit is contained in:
parent
5faa05a117
commit
af5a7a35c0
1 changed files with 7 additions and 11 deletions
|
@ -67,21 +67,17 @@
|
||||||
|
|
||||||
const shareLocalChat = async () => {
|
const shareLocalChat = async () => {
|
||||||
const chat = await getChatById(localStorage.token, $chatId);
|
const chat = await getChatById(localStorage.token, $chatId);
|
||||||
console.log('shareLocal', chat);
|
|
||||||
|
let chatShareUrl = '';
|
||||||
if (chat.share_id) {
|
if (chat.share_id) {
|
||||||
const shareUrl = `${window.location.origin}/s/${chat.share_id}`;
|
chatShareUrl = `${window.location.origin}/s/${chat.share_id}`;
|
||||||
toast.success(
|
|
||||||
$i18n.t('Chat is already shared at {{shareUrl}}, copied to clipboard', { shareUrl })
|
|
||||||
);
|
|
||||||
copyToClipboard(shareUrl);
|
|
||||||
} else {
|
} else {
|
||||||
const sharedChat = await shareChatById(localStorage.token, $chatId);
|
const sharedChat = await shareChatById(localStorage.token, $chatId);
|
||||||
const shareUrl = `${window.location.origin}/s/${sharedChat.id}`;
|
chatShareUrl = `${window.location.origin}/s/${sharedChat.id}`;
|
||||||
toast.success(
|
|
||||||
$i18n.t('Chat is now shared at {{shareUrl}}, copied to clipboard', { shareUrl })
|
|
||||||
);
|
|
||||||
copyToClipboard(shareUrl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toast.success($i18n.t('Copied shared conversation URL to clipboard!'));
|
||||||
|
copyToClipboard(chatShareUrl);
|
||||||
};
|
};
|
||||||
|
|
||||||
const downloadChat = async () => {
|
const downloadChat = async () => {
|
||||||
|
|
Loading…
Reference in a new issue