dynamic + check for statuss 200
This commit is contained in:
@@ -176,7 +176,7 @@ export class CreatePage {
|
|||||||
this.stopPolling();
|
this.stopPolling();
|
||||||
this.qrPolling.set(true);
|
this.qrPolling.set(true);
|
||||||
this.pollHandle = setInterval(() => {
|
this.pollHandle = setInterval(() => {
|
||||||
this.http.get<QrStatusResponse>(`${QR_VITANOVA_API}/qr/${encodeURIComponent(this.partnerqrID)}/${qrId}/`)
|
this.http.get<QrStatusResponse>(`${QR_VITANOVA_API}/qr/dynamic/${encodeURIComponent(this.partnerqrID)}/${qrId}/`)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: (res) => {
|
next: (res) => {
|
||||||
const st = res?.status ?? '';
|
const st = res?.status ?? '';
|
||||||
@@ -191,7 +191,9 @@ export class CreatePage {
|
|||||||
}
|
}
|
||||||
// REGISTERED / NEW / '' — keep polling
|
// REGISTERED / NEW / '' — keep polling
|
||||||
},
|
},
|
||||||
error: () => undefined
|
error: () => {
|
||||||
|
this.stopPolling();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user