changes
This commit is contained in:
@@ -47,7 +47,9 @@
|
||||
"modal_paid_title": "Paid",
|
||||
"modal_paid_sub": "fastCHECK successfully accepted.",
|
||||
"share_email": "Send by email",
|
||||
"share_tg": "Send via Telegram"
|
||||
"share_tg": "Send via Telegram",
|
||||
"modal_loggedin_title": "Signed in",
|
||||
"modal_loggedin_sub": "You are now signed in to fastCHECK."
|
||||
},
|
||||
"create": {
|
||||
"title": "New",
|
||||
|
||||
@@ -47,7 +47,9 @@
|
||||
"modal_paid_title": "Վճարված է",
|
||||
"modal_paid_sub": "fastCHECK-ը հաջողությամբ ընդունված է:",
|
||||
"share_email": "Ուղարկել էլ. նամակով",
|
||||
"share_tg": "Ուղարկել Telegram-ով"
|
||||
"share_tg": "Ուղարկել Telegram-ով",
|
||||
"modal_loggedin_title": "Մուտք գործել",
|
||||
"modal_loggedin_sub": "Դուք մուտք գործել եք fastCHECK:"
|
||||
},
|
||||
"create": {
|
||||
"title": "Նոր",
|
||||
|
||||
@@ -47,7 +47,9 @@
|
||||
"modal_paid_title": "Оплачено",
|
||||
"modal_paid_sub": "fastCHECK успешно принят.",
|
||||
"share_email": "Отправить на почту",
|
||||
"share_tg": "Отправить в Telegram"
|
||||
"share_tg": "Отправить в Telegram",
|
||||
"modal_loggedin_title": "Вы вошли",
|
||||
"modal_loggedin_sub": "Вы авторизованы в fastCHECK."
|
||||
},
|
||||
"create": {
|
||||
"title": "Новый",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 375 KiB After Width: | Height: | Size: 123 KiB |
@@ -133,11 +133,16 @@
|
||||
stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M20 6L9 17l-5-5" />
|
||||
</svg>
|
||||
@if (loginOnly()) {
|
||||
<h2 class="modal__title">{{ 'fastcheck.modal_loggedin_title' | translate }}</h2>
|
||||
<p class="modal__sub">{{ 'fastcheck.modal_loggedin_sub' | translate }}</p>
|
||||
} @else {
|
||||
<h2 class="modal__title">{{ 'fastcheck.modal_paid_title' | translate }}</h2>
|
||||
<p class="modal__sub">
|
||||
<span class="brand"><span class="brand__fast">fast</span><span class="brand__check">CHECK</span></span>
|
||||
{{ 'fastcheck.modal_paid_sub' | translate }}
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
} @else {
|
||||
<img class="brand-logo brand-logo--small" src="/logo_small.png"
|
||||
|
||||
@@ -56,6 +56,8 @@ export class FastcheckPage {
|
||||
popupError = signal<string>('');
|
||||
webSessionId = signal<string>('');
|
||||
paid = signal<boolean>(false);
|
||||
loginOnly = signal<boolean>(false);
|
||||
sessionToken = signal<string>(localStorage.getItem('fc_session') ?? '');
|
||||
private pollHandle: ReturnType<typeof setInterval> | null = null;
|
||||
private lastLookedUpNumber = '';
|
||||
|
||||
@@ -113,6 +115,7 @@ export class FastcheckPage {
|
||||
return;
|
||||
}
|
||||
this.error.set('');
|
||||
this.loginOnly.set(false);
|
||||
this.openPopup();
|
||||
}
|
||||
|
||||
@@ -122,6 +125,32 @@ export class FastcheckPage {
|
||||
this.paid.set(false);
|
||||
this.popupLoading.set(true);
|
||||
|
||||
const existing = this.sessionToken();
|
||||
if (existing) {
|
||||
this.http.get<WebSessionResponse>(`${FASTCHECK_API}/websession/${existing}`).subscribe({
|
||||
next: (res) => {
|
||||
if (res?.Status) {
|
||||
this.popupLoading.set(false);
|
||||
this.webSessionId.set(existing);
|
||||
if (this.loginOnly()) {
|
||||
this.paid.set(true);
|
||||
} else {
|
||||
this.acceptFastcheck(existing);
|
||||
}
|
||||
} else {
|
||||
this.sessionToken.set('');
|
||||
this.createNewSession();
|
||||
}
|
||||
},
|
||||
error: () => { this.sessionToken.set(''); this.createNewSession(); }
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.createNewSession();
|
||||
}
|
||||
|
||||
private createNewSession(): void {
|
||||
this.http.get<WebSessionResponse>(`${FASTCHECK_API}/websession`).subscribe({
|
||||
next: (res) => {
|
||||
this.popupLoading.set(false);
|
||||
@@ -142,13 +171,20 @@ export class FastcheckPage {
|
||||
closePopup(): void {
|
||||
this.popupOpen.set(false);
|
||||
this.stopPolling();
|
||||
if (this.webSessionId()) {
|
||||
if (this.loginOnly() && this.paid()) {
|
||||
// Keep session alive — user is logged in, preserve token for next action.
|
||||
const tok = this.webSessionId();
|
||||
localStorage.setItem('fc_session', tok);
|
||||
this.sessionToken.set(tok);
|
||||
} else if (this.webSessionId()) {
|
||||
// Best-effort logout; ignore errors.
|
||||
this.http
|
||||
.request('DELETE', `${FASTCHECK_API}/websession/${this.webSessionId()}`, {
|
||||
body: { sessionId: this.webSessionId() }
|
||||
})
|
||||
.subscribe({ error: () => undefined });
|
||||
localStorage.removeItem('fc_session');
|
||||
this.sessionToken.set('');
|
||||
}
|
||||
this.webSessionId.set('');
|
||||
}
|
||||
@@ -162,8 +198,12 @@ export class FastcheckPage {
|
||||
next: (res) => {
|
||||
if (res?.Status) {
|
||||
this.stopPolling();
|
||||
if (this.loginOnly()) {
|
||||
this.paid.set(true);
|
||||
} else {
|
||||
this.acceptFastcheck(sessionId);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: () => undefined
|
||||
});
|
||||
@@ -285,9 +325,7 @@ export class FastcheckPage {
|
||||
}
|
||||
|
||||
shareByTelegram(): void {
|
||||
const num = this.fastcheckNumber();
|
||||
const amount = this.fastcheckAmount();
|
||||
const text = encodeURIComponent(`fastCHECK: ${num} — ${amount} ₽`);
|
||||
window.open(`https://t.me/share/url?url=https%3A%2F%2Fqr.vitanova.network%2F&text=${text}`, '_blank');
|
||||
this.loginOnly.set(true);
|
||||
this.openPopup();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user