This commit is contained in:
2026-05-14 15:37:15 +04:00
parent 9cbb6660f8
commit 9c96370235

View File

@@ -245,22 +245,30 @@ export class CreatePage {
this.http
.post(`https://fastcheck.store/api/fastcheck/settings/${encodeURIComponent(id)}`, paidQr)
.subscribe({
next: () => this.redirectToSource(),
error: () => this.redirectToSource()
next: () => this.redirectToSource(id),
error: () => this.redirectToSource(id)
});
}
private redirectToSource(): void {
private redirectToSource(id?: string): void {
const withId = (target: string): string => {
if (!id) return target;
const url = new URL(target, window.location.origin);
url.searchParams.set('id', id);
return url.toString();
};
const alias = this.parentAlias.trim().toLowerCase();
const fromAlias = this.parentRedirects[alias];
if (fromAlias) {
window.location.href = fromAlias;
window.location.href = withId(fromAlias);
return;
}
const referrer = document.referrer;
if (referrer) {
window.location.href = referrer;
window.location.href = withId(referrer);
return;
}