Skip to content

Commit

Permalink
Merge pull request #106 from Suwayomi/main
Browse files Browse the repository at this point in the history
window not defined on build
  • Loading branch information
Robonau authored Dec 9, 2023
2 parents fb29a8d + c0ed758 commit 5b0b16d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib/apollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ const httpLink = createUploadLink({ uri: '/api/graphql' }) as unknown as ApolloL

let splitLink: ApolloLink = httpLink;

const url = window.location.origin
? window.location.origin.replace(/^http/, 'ws') + '/api/graphql'
: 'http://tachidesk:4567';
let url = 'http://tachidesk:4567';
if (typeof window !== 'undefined') {
url = window.location.origin.replace(/^http/, 'ws') + '/api/graphql';
}

try {
const wsLink = new GraphQLWsLink(
Expand Down

0 comments on commit 5b0b16d

Please sign in to comment.