fix(authentication): provider selection

This commit is contained in:
Wroud
2020-05-16 01:27:40 +03:00
parent fde5e1bdca
commit cc17df161d
2 changed files with 3 additions and 3 deletions
@@ -7,6 +7,7 @@
*/
import { observer } from 'mobx-react';
import { useEffect } from 'react';
import { useTabState, Tab as BaseTab, TabList } from 'reakit/Tab';
import styled, { css } from 'reshadow';
@@ -101,6 +102,7 @@ export const AuthDialog: DialogComponent<null, null> = observer(
selectedId: controller.provider?.id,
});
tab.selectedId = controller.provider?.id || null;
useEffect(() => controller.selectProvider(tab.selectedId!), [tab.selectedId]);
return styled(useStyles(styles))(
<CommonDialogWrapper
@@ -102,9 +102,7 @@ export class AuthDialogController implements IInitializableController, IDestruct
return providerA.label.localeCompare(providerB.label);
}
if (providerA.defaultProvider === providerB.defaultProvider) {
return 0;
} if (providerA.defaultProvider) {
if (providerA.defaultProvider) {
return -1;
}
return 1;