Skip to content

Commit b83ac58

Browse files
authored
fit(frontend): fix getOpenPaymentsUrl function (#3162)
1 parent 61a4028 commit b83ac58

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/frontend/app/shared/utils.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,18 @@ export function capitalize(str: string) {
6060
}
6161

6262
export function getOpenPaymentsUrl() {
63-
if (!process.env.OPEN_PAYMENTS_URL) {
64-
throw new Error('Environment variable OPEN_PAYMENTS_URL is missing')
65-
}
66-
6763
if (typeof window === 'undefined') {
64+
if (!process.env.OPEN_PAYMENTS_URL) {
65+
throw new Error('Environment variable OPEN_PAYMENTS_URL is missing')
66+
}
67+
6868
return process.env.OPEN_PAYMENTS_URL
6969
}
7070

71+
if (!window.ENV.OPEN_PAYMENTS_URL) {
72+
throw new Error('Environment variable OPEN_PAYMENTS_URL is missing')
73+
}
74+
7175
return window.ENV.OPEN_PAYMENTS_URL
7276
}
7377

0 commit comments

Comments
 (0)