Move to websocket for requests to signal server
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
import * as Bytes from '../Bytes';
|
||||
import { longRunningTaskWrapper } from '../util/longRunningTaskWrapper';
|
||||
import { isGroupV1 } from '../util/whatTypeOfConversation';
|
||||
import { explodePromise } from '../util/explodePromise';
|
||||
|
||||
import type { ConversationAttributesType } from '../model-types.d';
|
||||
import type { ConversationModel } from '../models/conversations';
|
||||
@@ -175,7 +176,7 @@ export async function joinViaLink(hash: string): Promise<void> {
|
||||
};
|
||||
|
||||
// Explode a promise so we know when this whole join process is complete
|
||||
const { promise, resolve, reject } = explodePromise();
|
||||
const { promise, resolve, reject } = explodePromise<void>();
|
||||
|
||||
const closeDialog = async () => {
|
||||
try {
|
||||
@@ -405,26 +406,3 @@ function showErrorDialog(description: string, title: string) {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function explodePromise(): {
|
||||
promise: Promise<void>;
|
||||
resolve: () => void;
|
||||
reject: (error: Error) => void;
|
||||
} {
|
||||
let resolve: () => void;
|
||||
let reject: (error: Error) => void;
|
||||
|
||||
const promise = new Promise<void>((innerResolve, innerReject) => {
|
||||
resolve = innerResolve;
|
||||
reject = innerReject;
|
||||
});
|
||||
|
||||
return {
|
||||
promise,
|
||||
// Typescript thinks that resolve and reject can be undefined here.
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
resolve: resolve!,
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
reject: reject!,
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user