fix(clipboard): use navigator.clipboard.writeText as primary, arboard as fallback — fixes silent failure on Linux/XWayland
This commit is contained in:
@@ -417,7 +417,9 @@
|
||||
async function finaliseTranscription(audioPath = null) {
|
||||
if (transcript.trim()) {
|
||||
if (settings.autoCopy) {
|
||||
invoke("copy_to_clipboard", { text: transcript }).catch(() => {});
|
||||
navigator.clipboard.writeText(transcript).catch(() => {
|
||||
invoke("copy_to_clipboard", { text: transcript }).catch(() => {});
|
||||
});
|
||||
}
|
||||
|
||||
const historyId = crypto.randomUUID();
|
||||
@@ -464,7 +466,11 @@
|
||||
}
|
||||
|
||||
function copyAll() {
|
||||
if (transcript) invoke("copy_to_clipboard", { text: transcript }).catch(() => {});
|
||||
if (transcript) {
|
||||
navigator.clipboard.writeText(transcript).catch(() => {
|
||||
invoke("copy_to_clipboard", { text: transcript }).catch(() => {});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function clearTranscript() {
|
||||
|
||||
@@ -118,7 +118,11 @@
|
||||
}
|
||||
|
||||
function copyAll() {
|
||||
if (fileTranscript) invoke("copy_to_clipboard", { text: fileTranscript }).catch(() => {});
|
||||
if (fileTranscript) {
|
||||
navigator.clipboard.writeText(fileTranscript).catch(() => {
|
||||
invoke("copy_to_clipboard", { text: fileTranscript }).catch(() => {});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function handleExport(format) {
|
||||
|
||||
@@ -178,7 +178,9 @@
|
||||
}
|
||||
|
||||
function copyItem(item) {
|
||||
invoke("copy_to_clipboard", { text: item.text }).catch(() => {});
|
||||
navigator.clipboard.writeText(item.text).catch(() => {
|
||||
invoke("copy_to_clipboard", { text: item.text }).catch(() => {});
|
||||
});
|
||||
}
|
||||
|
||||
function removeItem(item) {
|
||||
|
||||
@@ -194,7 +194,10 @@
|
||||
|
||||
function copySegment(idx) {
|
||||
if (item?.segments?.[idx]) {
|
||||
invoke("copy_to_clipboard", { text: item.segments[idx].text.trim() }).catch(() => {});
|
||||
const text = item.segments[idx].text.trim();
|
||||
navigator.clipboard.writeText(text).catch(() => {
|
||||
invoke("copy_to_clipboard", { text }).catch(() => {});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user