Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit f596e93

Browse files
committed
fix build
1 parent d9b0f6c commit f596e93

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/components/FeedbackForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const FeedbackForm = () => {
4949
>
5050
<input
5151
name="ua"
52-
value={navigator.userAgent}
52+
value={typeof window !== 'undefined' ? window.navigator.userAgent : ''}
5353
className="hidden"
5454
readOnly
5555
/>

src/components/InstallNitric/OSContext.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ export interface OSContextProps {
1717

1818
// this function detects the operating system of the user and returns the name that will be used to sort the instructions
1919
function detectOS() {
20-
const userAgent = window.navigator.userAgent
20+
const userAgent =
21+
typeof window !== 'undefined' ? window.navigator.userAgent : ''
2122
if (userAgent.includes('Mac')) {
2223
return 'macOS'
2324
} else if (userAgent.includes('Win')) {

0 commit comments

Comments
 (0)