propogate join channel erros

pull/1225/head
Vincent 5 years ago
parent 39b41cb222
commit 54209e98a8

@ -89,17 +89,27 @@ export class OpenGroup {
// Make this not hard coded // Make this not hard coded
const channel = 1; const channel = 1;
const conversation = window.attemptConnection(server, channel); let conversation;
const groupId = OpenGroup.getGroupId(server, channel); try {
conversation = await window.attemptConnection(server, channel);
} catch (e) {
console.warn(e);
return;
}
return new OpenGroup({ return new OpenGroup({
server, server,
groupId, channel,
conversation.cid, conversationId: conversation?.cid,
}) });
}
return {serverInfo, connectionPromise}; public static async isConnected(server: string): Promise<boolean> {
if (!OpenGroup.validate(server)) {
return false;
}
return Boolean(window.lokiPublicChatAPI.findOrCreateServer(server));
} }
private static getServer(groupId: string, hasSSL: boolean): string | undefined { private static getServer(groupId: string, hasSSL: boolean): string | undefined {

Loading…
Cancel
Save