Merge pull request #797 from loki-project/bug-fixes

Bug fixes
pull/798/head
Mikunj Varsani 6 years ago committed by GitHub
commit 1c89d130c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -238,7 +238,7 @@
specialConvInited = true; specialConvInited = true;
}; };
const initAPIs = async () => { const initAPIs = () => {
if (window.initialisedAPI) { if (window.initialisedAPI) {
return; return;
} }
@ -251,7 +251,7 @@
// If already exists we registered as a secondary device // If already exists we registered as a secondary device
if (!window.lokiFileServerAPI) { if (!window.lokiFileServerAPI) {
window.lokiFileServerAPIFactory = new window.LokiFileServerAPI(ourKey); window.lokiFileServerAPIFactory = new window.LokiFileServerAPI(ourKey);
window.lokiFileServerAPI = await window.lokiFileServerAPIFactory.establishHomeConnection( window.lokiFileServerAPI = window.lokiFileServerAPIFactory.establishHomeConnection(
window.getDefaultFileServer() window.getDefaultFileServer()
); );
} }
@ -1468,7 +1468,7 @@
const ourKey = textsecure.storage.user.getNumber(); const ourKey = textsecure.storage.user.getNumber();
window.lokiMessageAPI = new window.LokiMessageAPI(ourKey); window.lokiMessageAPI = new window.LokiMessageAPI(ourKey);
window.lokiFileServerAPIFactory = new window.LokiFileServerAPI(ourKey); window.lokiFileServerAPIFactory = new window.LokiFileServerAPI(ourKey);
window.lokiFileServerAPI = await window.lokiFileServerAPIFactory.establishHomeConnection( window.lokiFileServerAPI = window.lokiFileServerAPIFactory.establishHomeConnection(
window.getDefaultFileServer() window.getDefaultFileServer()
); );
window.lokiPublicChatAPI = null; window.lokiPublicChatAPI = null;
@ -1488,7 +1488,7 @@
return; return;
} }
await initAPIs(); initAPIs();
await initSpecialConversations(); await initSpecialConversations();
messageReceiver = new textsecure.MessageReceiver( messageReceiver = new textsecure.MessageReceiver(
USERNAME, USERNAME,

@ -291,14 +291,14 @@ class LokiFileServerFactoryAPI {
this.servers = []; this.servers = [];
} }
async establishHomeConnection(serverUrl) { establishHomeConnection(serverUrl) {
let thisServer = this.servers.find( let thisServer = this.servers.find(
server => server._server.baseServerUrl === serverUrl server => server._server.baseServerUrl === serverUrl
); );
if (!thisServer) { if (!thisServer) {
thisServer = new LokiHomeServerInstance(this.ourKey); thisServer = new LokiHomeServerInstance(this.ourKey);
log.info(`Registering HomeServer ${serverUrl}`); log.info(`Registering HomeServer ${serverUrl}`);
await thisServer.establishConnection(serverUrl); thisServer.establishConnection(serverUrl);
this.servers.push(thisServer); this.servers.push(thisServer);
} }
return thisServer; return thisServer;

@ -406,7 +406,8 @@ export class LeftPaneChannelSection extends React.Component<Props, State> {
return; return;
} }
await window.doCreateGroup(groupName, groupMembers); const groupMemberIds = groupMembers.map(m => m.id);
await window.doCreateGroup(groupName, groupMemberIds);
this.handleToggleOverlay(undefined); this.handleToggleOverlay(undefined);
window.pushToast({ window.pushToast({

Loading…
Cancel
Save