Terminate gql subscription on server address change
Otherwise, the subscription is still active for the old server instead of connecting to the new server
This commit is contained in:
@@ -9,14 +9,10 @@
|
||||
import { AppStorage } from '@/util/AppStorage.ts';
|
||||
|
||||
export abstract class BaseClient<Client, ClientConfig, Fetcher> {
|
||||
protected client!: Client;
|
||||
protected abstract client: Client;
|
||||
|
||||
public abstract readonly fetcher: Fetcher;
|
||||
|
||||
constructor() {
|
||||
this.createClient();
|
||||
}
|
||||
|
||||
public getBaseUrl(): string {
|
||||
const { hostname, port, protocol } = window.location;
|
||||
|
||||
@@ -25,7 +21,5 @@ export abstract class BaseClient<Client, ClientConfig, Fetcher> {
|
||||
return AppStorage.local.getItemParsed('serverBaseURL', `${protocol}//${hostname}:${inferredPort}`);
|
||||
}
|
||||
|
||||
protected abstract createClient(): void;
|
||||
|
||||
public abstract updateConfig(config: Partial<ClientConfig>): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user