mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-25 10:16:48 +08:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
@@ -242,6 +242,7 @@
|
||||
right: -20px;
|
||||
transition: all ease 0.3s;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.chat-item-delete-collapse {
|
||||
|
||||
@@ -9,6 +9,7 @@ export function trimTopic(topic: string) {
|
||||
export async function copyToClipboard(text: string) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
showToast(Locale.Copy.Success);
|
||||
} catch (error) {
|
||||
const textArea = document.createElement("textarea");
|
||||
textArea.value = text;
|
||||
@@ -17,11 +18,11 @@ export async function copyToClipboard(text: string) {
|
||||
textArea.select();
|
||||
try {
|
||||
document.execCommand("copy");
|
||||
showToast(Locale.Copy.Success);
|
||||
} catch (error) {
|
||||
showToast(Locale.Copy.Failed);
|
||||
}
|
||||
} finally {
|
||||
showToast(Locale.Copy.Success);
|
||||
document.body.removeChild(textArea);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user