Skip to content

Commit

Permalink
fix login screen options
Browse files Browse the repository at this point in the history
  • Loading branch information
Proxwian committed Feb 29, 2024
1 parent 4f05f19 commit de1e41b
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions src/app/desktop/views/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,14 @@ const Login = () => {
};

const authSelectedBackend = () => {
if (selectedBackend == 'mojang') {
loginMojang(email, password)
} else if (selectedBackend == 'oxauth') {
if (selectedBackend == 'OxAUTH') {
loginOx(email, password);
} else if (selectedBackend == 'elyby') {
} else if (selectedBackend == 'ElyBy') {
loginElyBy(email, password);
} else if (selectedBackend == 'offline') {
} else if (selectedBackend == 'Offline') {
loginOffline(email);
} else {
loginMojang(email, password)
}
}

Expand All @@ -196,6 +196,8 @@ const Login = () => {

useKey(['Enter'], authenticate);

setSelectedBackend('Mojang');

useEffect(() => {
ipcRenderer.invoke('getAppVersion').then(setVersion).catch(console.error);
}, []);
Expand All @@ -209,18 +211,26 @@ const Login = () => {
<a href="https://oxlauncher.ru"><HorizontalLogo size={200} /></a>
</Header>
<Form>
{selectedBackend != 'mojang' ? (
<div>
<div>
{selectedBackend != 'Mojang' ? (
<Input
placeholder="Никнейм"
value={email}
onChange={({ target: { value } }) => setEmail(value)}
/>
) : null }

<br />

{selectedBackend != 'Offline' ? (
<Input
placeholder="Пароль"
value={password}
onChange={({ target: { value } }) => setPassword(value)}
/>
) : null }

{selectedBackend != 'Mojang' ? (
<LoginButton color="primary" onClick={authenticate}>
Войти
<FontAwesomeIcon
Expand All @@ -230,7 +240,6 @@ const Login = () => {
icon={faArrowRight}
/>
</LoginButton>
</div>
) : (
<MicrosoftLoginButton
color="primary"
Expand All @@ -245,20 +254,21 @@ const Login = () => {
/>
</MicrosoftLoginButton>
)}
</div>

{loginFailed && (
<LoginFailMessage>{loginFailed?.message}</LoginFailMessage>
)}

<Select
css={`
width: 100px;
width: 200px;
margin: 10px;
`}
onChange={v => {
setSelectedBackend(v);
}}
placeholder="Авторизация"
placeholder="Mojang"
virtual={false}
>
{Object.entries(BACKEND_SERVERS).map(([k, v]) => (
Expand Down

0 comments on commit de1e41b

Please sign in to comment.