Skip to content

Commit

Permalink
fix issue for nextUp with restart delay
Browse files Browse the repository at this point in the history
  • Loading branch information
swantzter committed Jul 2, 2024
1 parent 4755d02 commit 5c14d42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/apollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const apiDomain = computed(() => {

function createLink () {
const wsLink = new WebSocketLink({
url: () => { return import.meta.env.VITE_GRAPHQL_WS_ENDPOINT ?? `wss://${apiDomain.value}/graphql` },
url: () => { return import.meta.env.VITE_GRAPHQL_WS_ENDPOINT ?? `${apiDomain.value.includes('localhost') ? 'ws' : 'wss'}://${apiDomain.value}/graphql` },
lazy: true,
connectionParams: async () => {
const oldAuth = useAuth()
Expand Down Expand Up @@ -93,7 +93,7 @@ function createLink () {
})

const httpLink = createHttpLink({
uri: () => { return import.meta.env.VITE_GRAPHQL_ENDPOINT ?? `https://${apiDomain.value}/graphql` }
uri: () => { return import.meta.env.VITE_GRAPHQL_ENDPOINT ?? `${apiDomain.value.includes('localhost') ? 'http' : 'https'}://${apiDomain.value}/graphql` }
})

const authLink = setContext(async (_, { headers }) => {
Expand Down
3 changes: 3 additions & 0 deletions src/views/NextUp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ const route = useRoute()
const groupInfo = useGroupInfoQuery({
groupId: route.params.groupId as string
}, {
pollInterval: 30_000,
fetchPolicy: 'cache-and-network'
})
const heatChangeSubscription = useHeatChangedSubscription({
groupId: route.params.groupId as string
Expand Down

0 comments on commit 5c14d42

Please sign in to comment.