fixes
This commit is contained in:
@@ -91,13 +91,5 @@ export class App implements OnInit {
|
|||||||
console.error('Update check failed:', err);
|
console.error('Update check failed:', err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.swUpdate.versionUpdates
|
|
||||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
||||||
.subscribe(event => {
|
|
||||||
if (event.type === 'VERSION_READY') {
|
|
||||||
console.log('New app version ready');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ export class TelegramLoginComponent implements OnDestroy {
|
|||||||
private pollTimer?: ReturnType<typeof setInterval>;
|
private pollTimer?: ReturnType<typeof setInterval>;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
console.log('TelegramLoginComponent initialized');
|
|
||||||
effect(() => {
|
effect(() => {
|
||||||
if (this.showDialog()) {
|
if (this.showDialog()) {
|
||||||
this.initQrLogin();
|
this.initQrLogin();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export interface AuthSession {
|
export interface AuthSession {
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
userId: any;
|
userId: number | null;
|
||||||
username: string | null;
|
username: string | null;
|
||||||
displayName: string;
|
displayName: string;
|
||||||
active: boolean;
|
active: boolean;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Component, computed, ChangeDetectionStrategy, signal, OnDestroy, inject } from '@angular/core';
|
import { Component, ChangeDetectionStrategy, signal, OnDestroy, inject } from '@angular/core';
|
||||||
import { DecimalPipe } from '@angular/common';
|
import { DecimalPipe } from '@angular/common';
|
||||||
import { Router, RouterLink } from '@angular/router';
|
import { Router, RouterLink } from '@angular/router';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
@@ -65,7 +65,6 @@ export class CartComponent implements OnDestroy {
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
private langService: LanguageService
|
private langService: LanguageService
|
||||||
) {
|
) {
|
||||||
console.log('CartComponent initialized');
|
|
||||||
this.items = this.cartService.items;
|
this.items = this.cartService.items;
|
||||||
this.itemCount = this.cartService.itemCount;
|
this.itemCount = this.cartService.itemCount;
|
||||||
this.totalPrice = this.cartService.totalPrice;
|
this.totalPrice = this.cartService.totalPrice;
|
||||||
@@ -233,7 +232,6 @@ export class CartComponent implements OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
startPolling(): void {
|
startPolling(): void {
|
||||||
console.log('Starting payment status polling CART');
|
|
||||||
this.stopPolling();
|
this.stopPolling();
|
||||||
if (!this.paymentId()) {
|
if (!this.paymentId()) {
|
||||||
this.setPaymentError();
|
this.setPaymentError();
|
||||||
@@ -437,9 +435,8 @@ export class CartComponent implements OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getTelegramUserId(): string | null {
|
private getTelegramUserId(): string | null {
|
||||||
console.log('Getting Telegram User ID', this.authService.session(), window.Telegram?.WebApp?.initDataUnsafe?.user);
|
|
||||||
const sessionTelegramUserId = this.authService.session()?.userId;
|
const sessionTelegramUserId = this.authService.session()?.userId;
|
||||||
if (sessionTelegramUserId) {
|
if (sessionTelegramUserId !== null && sessionTelegramUserId !== undefined) {
|
||||||
return sessionTelegramUserId.toString();
|
return sessionTelegramUserId.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -215,8 +215,8 @@ export class AuthService {
|
|||||||
?? this.readString(this.readFirst(user, ['displayName', 'DisplayName', 'name', 'Name']))
|
?? this.readString(this.readFirst(user, ['displayName', 'DisplayName', 'name', 'Name']))
|
||||||
const displayName = explicitDisplayName ?? username ?? (fullName || 'Telegram User');
|
const displayName = explicitDisplayName ?? username ?? (fullName || 'Telegram User');
|
||||||
const telegramUserId = this.readNumber(this.readFirst(user, ['userId','telegramUserId', 'telegramUserID', 'TelegramUserID', 'id', 'ID']))
|
const telegramUserId = this.readNumber(this.readFirst(user, ['userId','telegramUserId', 'telegramUserID', 'TelegramUserID', 'id', 'ID']))
|
||||||
?? this.readNumber(this.readFirst(response, ['telegramUserId', 'telegramUserID', 'TelegramUserID', 'userID', 'UserID', 'UserId']))
|
?? this.readNumber(this.readFirst(response, ['userId', 'telegramUserId', 'telegramUserID', 'TelegramUserID', 'userID', 'UserID', 'UserId']))
|
||||||
?? 0;
|
?? null;
|
||||||
const expiresAt = this.readString(this.readFirst(response, ['expiresAt', 'ExpiresAt', 'expires', 'Expires']))
|
const expiresAt = this.readString(this.readFirst(response, ['expiresAt', 'ExpiresAt', 'expires', 'Expires']))
|
||||||
?? new Date(Date.now() + WEB_SESSION_COOKIE_MAX_AGE_SECONDS * 1000).toISOString();
|
?? new Date(Date.now() + WEB_SESSION_COOKIE_MAX_AGE_SECONDS * 1000).toISOString();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user