From 00d45e7cc43c0bd2025cad9fd9e954a57487f888 Mon Sep 17 00:00:00 2001 From: leedom Date: Fri, 7 Apr 2023 13:47:34 +0800 Subject: [PATCH] fix: solve navigator undefined && merge from main --- app/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/utils.ts b/app/utils.ts index fa32535d..6d52bb4d 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -52,7 +52,9 @@ export function isMobileScreen() { } export function isFirefox() { - return /firefox/i.test(navigator.userAgent); + return ( + typeof navigator !== "undefined" && /firefox/i.test(navigator.userAgent) + ); } export function selectOrCopy(el: HTMLElement, content: string) {