mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
desktop: hide window thumbnail on Windows in privacy mode
This commit is contained in:
committed by
Abdullah Atta
parent
cc39fac590
commit
06aff69adb
@@ -34,6 +34,7 @@ import { sendMessageToRenderer } from "./ipc/utils";
|
||||
import { EVENTS } from "./events";
|
||||
import "./ipc/index.js";
|
||||
import getPrivacyMode from "./ipc/calls/getPrivacyMode";
|
||||
import setPrivacyMode from "./ipc/actions/setPrivacyMode";
|
||||
|
||||
if (!RELEASE) {
|
||||
require("electron-reloader")(module);
|
||||
@@ -88,7 +89,7 @@ async function createWindow() {
|
||||
mainWindow.webContents.openDevTools({ mode: "right", activate: true });
|
||||
|
||||
if (getPrivacyMode()) {
|
||||
global.win.setContentProtection(true);
|
||||
setPrivacyMode({ privacyMode: getPrivacyMode() });
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -23,5 +23,10 @@ export default (args) => {
|
||||
if (!global.win) return;
|
||||
const { privacyMode } = args;
|
||||
global.win.setContentProtection(privacyMode);
|
||||
global.win.setThumbnailClip(
|
||||
privacyMode
|
||||
? { x: 0, y: 0, width: 1, height: 1 }
|
||||
: { x: 0, y: 0, width: 0, height: 0 }
|
||||
);
|
||||
setPrivacyMode(privacyMode);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user