mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
desktop: prevent setting privacy mode on linux
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user