From 6c3618cb6506c652a6ca42927127f22e5d189772 Mon Sep 17 00:00:00 2001 From: Martin Fournier Date: Mon, 3 Jan 2022 10:33:58 -0500 Subject: [PATCH] Check userAgent before running electron init --- src/Electron.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Electron.tsx b/src/Electron.tsx index 9931d3a5e..0b71fa94f 100644 --- a/src/Electron.tsx +++ b/src/Electron.tsx @@ -417,10 +417,14 @@ function calculateAchievements(): void { } export function initElectron(): void { - setAchievements([]); - initWebserver(); - setInterval(calculateAchievements, 5000); - initAppNotifier(); + const userAgent = navigator.userAgent.toLowerCase(); + if (userAgent.indexOf(' electron/') > -1) { + // Electron-specific code + setAchievements([]); + initWebserver(); + setInterval(calculateAchievements, 5000); + initAppNotifier(); + } } function initWebserver(): void {