Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

desktop: prevent setting privacy mode on linux

Abdullah Atta6f2127abb8fe
diff --git a/apps/web/desktop/ipc/actions/setPrivacyMode.js b/apps/web/desktop/ipc/actions/setPrivacyMode.js
index bd9995046..f84031062 100644
--- a/apps/web/desktop/ipc/actions/setPrivacyMode.js
+++ b/apps/web/desktop/ipc/actions/setPrivacyMode.js
@@ -20,13 +20,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { setPrivacyMode } from "../../config/privacyMode";
export default (args) => {
- if (!globalThis.window) return;
+ if (!globalThis.window || !["win32", "darwin"].includes(process.platform))
+ return;
+
const { privacyMode } = args;
globalThis.window.setContentProtection(privacyMode);
- globalThis.window.setThumbnailClip(
- privacyMode
- ? { x: 0, y: 0, width: 1, height: 1 }
- : { x: 0, y: 0, width: 0, height: 0 }
- );
+
+ if (process.platform === "win32") {
+ globalThis.window.setThumbnailClip(
+ privacyMode
+ ? { x: 0, y: 0, width: 1, height: 1 }
+ : { x: 0, y: 0, width: 0, height: 0 }
+ );
+ }
+
setPrivacyMode(privacyMode);
};