From 8c856e33f3fd63535fa9b4a7269de05af8e47186 Mon Sep 17 00:00:00 2001 From: Vincent Lecrubier Date: Tue, 18 Jan 2022 22:50:29 +0000 Subject: [PATCH 1/2] Fix performance bug --- src/util/browser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/browser.ts b/src/util/browser.ts index 8c0fdd33aa..8f4c1f3e57 100755 --- a/src/util/browser.ts +++ b/src/util/browser.ts @@ -1,6 +1,6 @@ import type {Cancelable} from '../types/cancelable'; -const now = performance && performance.now ? +const now = typeof window !== "undefined" && performance && performance.now ? performance.now.bind(performance) : Date.now.bind(Date); From 06a12c0485d4129723412b053f78c960e031fb1b Mon Sep 17 00:00:00 2001 From: Birk Skyum <74932975+birkskyum@users.noreply.github.com> Date: Fri, 28 Jan 2022 13:16:00 +0100 Subject: [PATCH 2/2] Lint --- src/util/browser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/browser.ts b/src/util/browser.ts index 8f4c1f3e57..ef06049533 100755 --- a/src/util/browser.ts +++ b/src/util/browser.ts @@ -1,6 +1,6 @@ import type {Cancelable} from '../types/cancelable'; -const now = typeof window !== "undefined" && performance && performance.now ? +const now = typeof window !== 'undefined' && performance && performance.now ? performance.now.bind(performance) : Date.now.bind(Date);