Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix: treat portal exit 0 with no token as failure on KDE Wayland

Alcahestf4003b2a4cd1
diff --git a/src/helpers/clipboard.js b/src/helpers/clipboard.js
index cb20b97d9..95a629916 100644
--- a/src/helpers/clipboard.js
+++ b/src/helpers/clipboard.js
@@ -345,6 +345,12 @@ class ClipboardManager {
if (newToken) {
this._savePortalToken(newToken);
}
+ // If no token existed before and none was returned, the portal
+ // exited 0 without actually pasting (observed on KDE Wayland).
+ if (!restoreToken && !newToken) {
+ reject(new Error("linux-fast-paste --portal exited 0 but produced no token"));
+ return;
+ }
resolve(newToken || null);
} else if (code === 5) {
reject(new Error("portal support not compiled in"));