Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
af5a7a35
Commit
af5a7a35
authored
Apr 02, 2024
by
Timothy J. Baek
Browse files
refac: copy to clipboard message
parent
5faa05a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
src/lib/components/layout/Navbar.svelte
src/lib/components/layout/Navbar.svelte
+7
-11
No files found.
src/lib/components/layout/Navbar.svelte
View file @
af5a7a35
...
@@ -67,21 +67,17 @@
...
@@ -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 () => {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment