Check userAgent before running electron init

This commit is contained in:
Martin Fournier 2022-01-03 10:33:58 -05:00
parent 6d8df6744e
commit 6c3618cb65

@ -417,11 +417,15 @@ function calculateAchievements(): void {
} }
export function initElectron(): void { export function initElectron(): void {
const userAgent = navigator.userAgent.toLowerCase();
if (userAgent.indexOf(' electron/') > -1) {
// Electron-specific code
setAchievements([]); setAchievements([]);
initWebserver(); initWebserver();
setInterval(calculateAchievements, 5000); setInterval(calculateAchievements, 5000);
initAppNotifier(); initAppNotifier();
} }
}
function initWebserver(): void { function initWebserver(): void {
(document as any).saveFile = function (filename: string, code: string): string { (document as any).saveFile = function (filename: string, code: string): string {