Browse Source

Fix double monkey on SRP after entering auth code

Fix big thumbs in password input
master
morethanwords 4 years ago
parent
commit
c835cee624
  1. 9
      src/pages/pageAuthCode.ts
  2. 9
      src/pages/pagePassword.ts
  3. 4
      src/pages/pageSignUp.ts
  4. 9
      src/scss/partials/pages/_password.scss

9
src/pages/pageAuthCode.ts

@ -160,15 +160,12 @@ let onFirstMount = (): Promise<any> => { @@ -160,15 +160,12 @@ let onFirstMount = (): Promise<any> => {
codeInput.innerText = response._;
break;
}
}).catch(err => {
codeInput.removeAttribute('disabled');
}).catch(async(err) => {
switch(err.type) {
case 'SESSION_PASSWORD_NEEDED':
//console.warn('pageAuthCode: SESSION_PASSWORD_NEEDED');
err.handled = true;
cleanup();
pagePassword.mount();
await pagePassword.mount();
break;
case 'PHONE_CODE_EMPTY':
case 'PHONE_CODE_INVALID':
@ -179,6 +176,8 @@ let onFirstMount = (): Promise<any> => { @@ -179,6 +176,8 @@ let onFirstMount = (): Promise<any> => {
codeInputLabel.innerText = err.type;
break;
}
codeInput.removeAttribute('disabled');
});
};

9
src/pages/pagePassword.ts

@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
//import apiManager from '../lib/mtproto/apiManager';
import { putPreloader } from '../components/misc';
import mediaSizes from '../helpers/mediaSizes';
import { isAppleMobile, isSafari } from '../helpers/userAgent';
import { AccountPassword } from '../layer';
import LottieLoader, { RLottiePlayer } from '../lib/lottieLoader';
//import passwordManager from '../lib/mtproto/passwordManager';
@ -11,7 +12,7 @@ import { cancelEvent } from '../lib/utils'; @@ -11,7 +12,7 @@ import { cancelEvent } from '../lib/utils';
import Page from './page';
import pageIm from './pageIm';
const TEST = false;
let passwordInput: HTMLInputElement;
let onFirstMount = (): Promise<any> => {
@ -26,7 +27,7 @@ let onFirstMount = (): Promise<any> => { @@ -26,7 +27,7 @@ let onFirstMount = (): Promise<any> => {
const toggleVisible = page.pageEl.querySelector('.toggle-visible') as HTMLSpanElement;
let getState = () => {
return passwordManager.getState().then(_state => {
return !TEST && passwordManager.getState().then(_state => {
state = _state;
passwordInputLabel.innerText = state.hint ?? 'Password';
@ -145,7 +146,9 @@ let onFirstMount = (): Promise<any> => { @@ -145,7 +146,9 @@ let onFirstMount = (): Promise<any> => {
};
const page = new Page('page-password', true, onFirstMount, null, () => {
passwordInput.focus();
//if(!isAppleMobile) {
passwordInput.focus();
//}
});
export default page;

4
src/pages/pageSignUp.ts

@ -90,9 +90,7 @@ let onFirstMount = () => import('../lib/appManagers/appProfileManager').then(imp @@ -90,9 +90,7 @@ let onFirstMount = () => import('../lib/appManagers/appProfileManager').then(imp
id: response.user.id
});
sendAvatar().then(() => {
pageIm.mount();
}, () => {
sendAvatar().finally(() => {
pageIm.mount();
});

9
src/scss/partials/pages/_password.scss

@ -6,10 +6,15 @@ @@ -6,10 +6,15 @@
font-size: 2.25rem;
padding-left: 10px;
html.is-ios & {
font-size: .75rem;
@media (-webkit-min-device-pixel-ratio: 2) {
font-size: 1.75rem;
letter-spacing: .125rem;
}
html.is-ios & {
// ! меньше 1rem будет зумить поле
font-size: 1rem;
}
}
}

Loading…
Cancel
Save