From dc48b256d688607190e7026163dcd15ce0ecc147 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 13 Dec 2024 20:31:25 -0600 Subject: [PATCH] Actually fix baseURL --- src/api/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index 225b27d9e..3d531c105 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -20,9 +20,9 @@ const getAuthBaseURL = createSelector([ /** Base client for HTTP requests. */ export const baseClient = ( accessToken?: string | null, - baseURL: string = location.origin, + baseURL?: string, ): MastodonClient => { - return new MastodonClient(baseURL, accessToken || undefined); + return new MastodonClient(baseURL || location.origin, accessToken || undefined); }; /** @@ -33,7 +33,7 @@ export default (getState: () => RootState, authType: string = 'user'): MastodonC const state = getState(); const accessToken = getToken(state, authType); const me = state.me; - const baseURL = BuildConfig.BACKEND_URL ?? (me ? getAuthBaseURL(state, me) : location.origin); + const baseURL = BuildConfig.BACKEND_URL || (me ? getAuthBaseURL(state, me) : undefined) || location.origin; return baseClient(accessToken, baseURL); };