From 6f2127abb8feeeed37d795869fc4ed5290243752 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Tue, 14 Feb 2023 10:00:52 +0500 Subject: [PATCH] desktop: prevent setting privacy mode on linux --- apps/web/desktop/ipc/actions/setPrivacyMode.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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 . 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); };