Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/lib/rocketchat/services/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,13 @@ function stopListener(listener: any): boolean {

async function login(credentials: ICredentials, isFromWebView = false): Promise<ILoggedUser | undefined> {
// RC 0.64.0
await sdk.current.login(credentials);
if (sdk.current) {
await sdk.current.login(credentials);
} else {
const { server } = store.getState().server;
sdk.initialize(server);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awkward to call initialize on login. We should have called it on server select instead of here.

await sdk.current.login(credentials);
}
const result = sdk.current.currentLogin?.result;
if (result) {
const user: ILoggedUser = {
Expand Down