dev #14384 Правка ошибок отображения WPA КофеЛайк: show only one message at a time and fix header
This commit is contained in:
parent
142ece15de
commit
e5ae004a29
@ -58,6 +58,7 @@ export class DownloadAppDirective implements OnInit {
|
|||||||
@HostListener('click', ['$event'])
|
@HostListener('click', ['$event'])
|
||||||
async downloadApp(event: MouseEvent) {
|
async downloadApp(event: MouseEvent) {
|
||||||
if (!this.deferredPrompt) {
|
if (!this.deferredPrompt) {
|
||||||
|
this.messageService.clear();
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'error',
|
severity: 'error',
|
||||||
summary: 'Не поддерживается в Вашем браузере!',
|
summary: 'Не поддерживается в Вашем браузере!',
|
||||||
@ -67,6 +68,7 @@ export class DownloadAppDirective implements OnInit {
|
|||||||
this.deferredPrompt.prompt();
|
this.deferredPrompt.prompt();
|
||||||
this.deferredPrompt.userChoice.then((res: any) => {
|
this.deferredPrompt.userChoice.then((res: any) => {
|
||||||
if (res.outcome === 'accepted') {
|
if (res.outcome === 'accepted') {
|
||||||
|
this.messageService.clear();
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'success',
|
severity: 'success',
|
||||||
summary: 'Спасибо за установку!',
|
summary: 'Спасибо за установку!',
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export class RefSystemComponent implements OnInit {
|
|||||||
true
|
true
|
||||||
)
|
)
|
||||||
)).data
|
)).data
|
||||||
|
|
||||||
this.refUrl += accountData.user_id
|
this.refUrl += accountData.user_id
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
@ -53,12 +53,14 @@ export class RefSystemComponent implements OnInit {
|
|||||||
copyUrl() {
|
copyUrl() {
|
||||||
navigator.clipboard.writeText(this.refUrl)
|
navigator.clipboard.writeText(this.refUrl)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
this.messageService.clear();
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'custom',
|
severity: 'custom',
|
||||||
summary: 'Ссылка скопирована!',
|
summary: 'Ссылка скопирована!',
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
|
this.messageService.clear();
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'error',
|
severity: 'error',
|
||||||
summary: 'Произошла ошибка!',
|
summary: 'Произошла ошибка!',
|
||||||
|
|||||||
@ -38,9 +38,9 @@ export class LoginComponent implements OnInit, AfterViewInit {
|
|||||||
private jsonrpc: JsonrpcService,
|
private jsonrpc: JsonrpcService,
|
||||||
private messageService: MessageService,
|
private messageService: MessageService,
|
||||||
private _snackBar: MatSnackBar
|
private _snackBar: MatSnackBar
|
||||||
) {}
|
) { }
|
||||||
|
|
||||||
ngOnInit(): void {}
|
ngOnInit(): void { }
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -72,7 +72,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
|
|||||||
const nextInputIndex = index + 1;
|
const nextInputIndex = index + 1;
|
||||||
if (event.target.value.length > 1) {
|
if (event.target.value.length > 1) {
|
||||||
event.target.value = event.target.value.slice(-1);
|
event.target.value = event.target.value.slice(-1);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (nextInputIndex > 0 && nextInputIndex <= this.inputIds.length) {
|
if (nextInputIndex > 0 && nextInputIndex <= this.inputIds.length) {
|
||||||
this.inputFocusEmitter.emit(`#${this.inputIds[nextInputIndex]}`);
|
this.inputFocusEmitter.emit(`#${this.inputIds[nextInputIndex]}`);
|
||||||
@ -85,6 +85,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
|
|||||||
const data = this.phoneForm.value;
|
const data = this.phoneForm.value;
|
||||||
this.isShowNumber = false;
|
this.isShowNumber = false;
|
||||||
if (this.timeLeft) {
|
if (this.timeLeft) {
|
||||||
|
this.messageService.clear();
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'custom',
|
severity: 'custom',
|
||||||
summary: `Отправить повторно можно через ${this.timeLeft}с`,
|
summary: `Отправить повторно можно через ${this.timeLeft}с`,
|
||||||
@ -95,29 +96,29 @@ export class LoginComponent implements OnInit, AfterViewInit {
|
|||||||
method: 'sendVerifyByPhone',
|
method: 'sendVerifyByPhone',
|
||||||
params: [data.phone]
|
params: [data.phone]
|
||||||
}, RpcService.authService, false).subscribe({
|
}, RpcService.authService, false).subscribe({
|
||||||
next: (result) => {
|
next: (result) => {
|
||||||
if (result.code !== 0) {
|
if (result.code !== 0) {
|
||||||
this._snackBar.open('Произошла ошибка! Попробуйте позже', '', {
|
this._snackBar.open('Произошла ошибка! Попробуйте позже', '', {
|
||||||
duration: 3000
|
duration: 3000
|
||||||
})
|
})
|
||||||
}
|
|
||||||
if (result.code === 0) {
|
|
||||||
this.timeLeft = 60;
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
if(this.timeLeft > 0) {
|
|
||||||
this.timeLeft--;
|
|
||||||
} else {
|
|
||||||
clearInterval(interval);
|
|
||||||
}
|
|
||||||
},1000)
|
|
||||||
}
|
|
||||||
this.isShowNumber = false;
|
|
||||||
},
|
|
||||||
error: (error) => {
|
|
||||||
console.error('Error: ', error);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (result.code === 0) {
|
||||||
|
this.timeLeft = 60;
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
if (this.timeLeft > 0) {
|
||||||
|
this.timeLeft--;
|
||||||
|
} else {
|
||||||
|
clearInterval(interval);
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
this.isShowNumber = false;
|
||||||
|
},
|
||||||
|
error: (error) => {
|
||||||
|
console.error('Error: ', error);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
);
|
);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.inputFocusEmitter.emit(`#${this.inputIds[0]}`);
|
this.inputFocusEmitter.emit(`#${this.inputIds[0]}`);
|
||||||
@ -130,28 +131,28 @@ export class LoginComponent implements OnInit, AfterViewInit {
|
|||||||
method: 'getTokenByPhone',
|
method: 'getTokenByPhone',
|
||||||
params: [this.phoneForm.value.phone, Object.values(data).join('')]
|
params: [this.phoneForm.value.phone, Object.values(data).join('')]
|
||||||
}, RpcService.authService, false).subscribe({
|
}, RpcService.authService, false).subscribe({
|
||||||
next: (result) => {
|
next: (result) => {
|
||||||
if (result.code === 0) {
|
if (result.code === 0) {
|
||||||
this.cookiesService.setCookie('token', result?.data?.token);
|
this.cookiesService.setCookie('token', result?.data?.token);
|
||||||
this.router.navigate(['/'], {
|
this.router.navigate(['/'], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
token: result?.data?.token
|
token: result?.data?.token
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// this.phoneConfirmed.emit(null);
|
// this.phoneConfirmed.emit(null);
|
||||||
} else if (result.code === 230) {
|
} else if (result.code === 230) {
|
||||||
this._snackBar.open('Неверный код!', '', {
|
this._snackBar.open('Неверный код!', '', {
|
||||||
duration: 3000
|
duration: 3000
|
||||||
})
|
})
|
||||||
// this.errorConfirmCode = true;
|
// this.errorConfirmCode = true;
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: (error) => {
|
|
||||||
console.error(error);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
error: (error) => {
|
||||||
|
console.error(error);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -61,12 +61,13 @@ export class MainComponent implements OnInit {
|
|||||||
const userAgent = window.navigator.userAgent.toLowerCase();
|
const userAgent = window.navigator.userAgent.toLowerCase();
|
||||||
const ios = /iphone|ipod|ipad/.test(userAgent);
|
const ios = /iphone|ipod|ipad/.test(userAgent);
|
||||||
if (ios) {
|
if (ios) {
|
||||||
|
this.messageService.clear();
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'custom',
|
severity: 'custom',
|
||||||
summary: `Чтобы получать уведомления, добавьте карту в Apple Wallet`,
|
summary: `Чтобы получать уведомления, добавьте карту в Apple Wallet`,
|
||||||
life: 5000,
|
life: 5000,
|
||||||
});
|
});
|
||||||
|
|
||||||
// var permissionData = window.safari.pushNotification.permission('web.com.example.domain');
|
// var permissionData = window.safari.pushNotification.permission('web.com.example.domain');
|
||||||
// $scope.checkRemotePermission(permissionData);
|
// $scope.checkRemotePermission(permissionData);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -44,6 +44,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
|
min-width: 40px;
|
||||||
}
|
}
|
||||||
.menu {
|
.menu {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@ -42,6 +42,7 @@ export class GuestCardComponent implements OnInit {
|
|||||||
const userAgent = window.navigator.userAgent.toLowerCase();
|
const userAgent = window.navigator.userAgent.toLowerCase();
|
||||||
const ios = /iphone|ipod|ipad/.test(userAgent);
|
const ios = /iphone|ipod|ipad/.test(userAgent);
|
||||||
if (ios) {
|
if (ios) {
|
||||||
|
this.messageService.clear();
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'custom',
|
severity: 'custom',
|
||||||
summary: `Чтобы получать уведомления, добавьте карту в Apple Wallet`,
|
summary: `Чтобы получать уведомления, добавьте карту в Apple Wallet`,
|
||||||
|
|||||||
@ -104,10 +104,10 @@ export class LoginComponent implements OnInit {
|
|||||||
if (this.phoneForm.invalid) {
|
if (this.phoneForm.invalid) {
|
||||||
this.phoneForm.markAsTouched();
|
this.phoneForm.markAsTouched();
|
||||||
|
|
||||||
|
this.messageService.clear();
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'error',
|
severity: 'error',
|
||||||
summary: 'Введите имя и телефон',
|
summary: 'Введите имя и телефон',
|
||||||
life: 5000,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -81,6 +81,7 @@ export class AuthService {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if (value && value.error && value.error.code > 1) {
|
} else if (value && value.error && value.error.code > 1) {
|
||||||
|
this.messageService.clear();
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'error',
|
severity: 'error',
|
||||||
summary: 'Произошла ошибка! Попробуйте позже',
|
summary: 'Произошла ошибка! Попробуйте позже',
|
||||||
@ -110,6 +111,7 @@ export class AuthService {
|
|||||||
|
|
||||||
sendVerifyByPhone(phone: string) {
|
sendVerifyByPhone(phone: string) {
|
||||||
if (this.timeLeft) {
|
if (this.timeLeft) {
|
||||||
|
this.messageService.clear();
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'custom',
|
severity: 'custom',
|
||||||
summary: `Отправить повторно можно через ${this.timeLeft}с`,
|
summary: `Отправить повторно можно через ${this.timeLeft}с`,
|
||||||
@ -130,6 +132,7 @@ export class AuthService {
|
|||||||
.subscribe({
|
.subscribe({
|
||||||
next: (result) => {
|
next: (result) => {
|
||||||
if (result.code !== 0) {
|
if (result.code !== 0) {
|
||||||
|
this.messageService.clear();
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'error',
|
severity: 'error',
|
||||||
summary: 'Произошла ошибка! Попробуйте позже',
|
summary: 'Произошла ошибка! Попробуйте позже',
|
||||||
@ -192,6 +195,7 @@ export class AuthService {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
} else if (result.code === 230) {
|
} else if (result.code === 230) {
|
||||||
|
this.messageService.clear();
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'error',
|
severity: 'error',
|
||||||
summary: 'Неверный код!',
|
summary: 'Неверный код!',
|
||||||
|
|||||||
@ -50,6 +50,7 @@ export class MessagingService {
|
|||||||
)
|
)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: () => {
|
next: () => {
|
||||||
|
this.messageService.clear();
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'custom',
|
severity: 'custom',
|
||||||
summary: 'Спасибо за подписку!',
|
summary: 'Спасибо за подписку!',
|
||||||
@ -57,6 +58,7 @@ export class MessagingService {
|
|||||||
},
|
},
|
||||||
error: (err) => {
|
error: (err) => {
|
||||||
console.error('Error: ', err);
|
console.error('Error: ', err);
|
||||||
|
this.messageService.clear();
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'error',
|
severity: 'error',
|
||||||
summary: 'Произошла ошибка, попробуйте позже',
|
summary: 'Произошла ошибка, попробуйте позже',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user