From 2926795276a8c0478f7ae7562420a3fe6ff19467 Mon Sep 17 00:00:00 2001 From: Colton Shaw <46071821+coltoneshaw@users.noreply.github.com> Date: Mon, 1 Nov 2021 23:55:00 -0400 Subject: [PATCH] Fixed isElectron window issue --- src/utils/helperFunctions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/helperFunctions.ts b/src/utils/helperFunctions.ts index cf187d9d..de4b1ab1 100644 --- a/src/utils/helperFunctions.ts +++ b/src/utils/helperFunctions.ts @@ -1,7 +1,7 @@ import { parseISO, differenceInMilliseconds } from 'date-fns' -const isElectron = window.mainPreload +const isElectron = () => window.mainPreload /** * * @param jsonString the json string to be validated @@ -132,7 +132,7 @@ function getDatesBetweenTwoDates(startDate: string, endDate: string) { } const openLink = (url: string) => { - if (isElectron) return window.ThreeCPM.Repository.General.openLink(url); + if (isElectron()) return window.ThreeCPM.Repository.General.openLink(url); return window.open(url) }