From 9c9637023594dae64736427a9417d1b437c1acb1 Mon Sep 17 00:00:00 2001 From: sdarbinyan Date: Thu, 14 May 2026 15:37:15 +0400 Subject: [PATCH] location --- src/app/pages/create-page/create-page.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/app/pages/create-page/create-page.ts b/src/app/pages/create-page/create-page.ts index f78ff12..7b26b65 100644 --- a/src/app/pages/create-page/create-page.ts +++ b/src/app/pages/create-page/create-page.ts @@ -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; }