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) {
|
async function finaliseTranscription(audioPath = null) {
|
||||||
if (transcript.trim()) {
|
if (transcript.trim()) {
|
||||||
if (settings.autoCopy) {
|
if (settings.autoCopy) {
|
||||||
|
navigator.clipboard.writeText(transcript).catch(() => {
|
||||||
invoke("copy_to_clipboard", { text: transcript }).catch(() => {});
|
invoke("copy_to_clipboard", { text: transcript }).catch(() => {});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const historyId = crypto.randomUUID();
|
const historyId = crypto.randomUUID();
|
||||||
@@ -464,7 +466,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function copyAll() {
|
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() {
|
function clearTranscript() {
|
||||||
|
|||||||
@@ -118,7 +118,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function copyAll() {
|
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) {
|
function handleExport(format) {
|
||||||
|
|||||||
@@ -178,7 +178,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function copyItem(item) {
|
function copyItem(item) {
|
||||||
|
navigator.clipboard.writeText(item.text).catch(() => {
|
||||||
invoke("copy_to_clipboard", { text: item.text }).catch(() => {});
|
invoke("copy_to_clipboard", { text: item.text }).catch(() => {});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeItem(item) {
|
function removeItem(item) {
|
||||||
|
|||||||
@@ -194,7 +194,10 @@
|
|||||||
|
|
||||||
function copySegment(idx) {
|
function copySegment(idx) {
|
||||||
if (item?.segments?.[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