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:
@@ -27,6 +27,8 @@ export class RestClient
|
||||
extends BaseClient<typeof fetch, RequestInit, (url: string, data: any) => Promise<Response>>
|
||||
implements IRestClient
|
||||
{
|
||||
protected client!: typeof fetch;
|
||||
|
||||
private config: RequestInit = {
|
||||
credentials: 'include',
|
||||
};
|
||||
@@ -78,7 +80,13 @@ export class RestClient
|
||||
return result;
|
||||
};
|
||||
|
||||
protected override createClient(): void {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.createClient();
|
||||
}
|
||||
|
||||
private createClient(): void {
|
||||
this.client = fetch.bind(window);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user