From c657eef52cd8a47ed64e1623e4cc04780cbc6607 Mon Sep 17 00:00:00 2001 From: Alexis Tyler Date: Thu, 22 Jul 2021 10:33:03 +0930 Subject: [PATCH] fix: subscribe to servers --- app/mothership/index.ts | 2 ++ app/mothership/subscribe-to-servers.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/mothership/index.ts b/app/mothership/index.ts index cad25590b..a04694c83 100644 --- a/app/mothership/index.ts +++ b/app/mothership/index.ts @@ -8,6 +8,7 @@ import { varState } from '../core/states/var'; import packageJson from '../../package.json'; import { paths } from '../core/paths'; import { loadState } from '../core/utils/misc/load-state'; +import { subscribeToServers } from './subscribe-to-servers'; export const sockets = { internal: null as GracefulWebSocket | null, @@ -35,6 +36,7 @@ export const startInternal = (apiKey: string) => { // Internal is ready at this point if (!sockets.relay) { startRelay(apiKey); + subscribeToServers(apiKey); } }); diff --git a/app/mothership/subscribe-to-servers.ts b/app/mothership/subscribe-to-servers.ts index ce2d3b8bc..9f15ea4eb 100644 --- a/app/mothership/subscribe-to-servers.ts +++ b/app/mothership/subscribe-to-servers.ts @@ -21,7 +21,7 @@ export const mothership = new SubscriptionClient(MOTHERSHIP_GRAPHQL_LINK, { } }); -export const subscribeToServers = async (apiKey: string) => { +export const subscribeToServers = (apiKey: string) => { log.silly('Subscribing to servers with %s', apiKey); const query = mothership.request({ query: `subscription servers ($apiKey: String!) {