set this.status after checking the response is OK

pull/923/head
Molham 2025-04-19 14:48:10 +02:00 committed by Bastien Wirtz
parent 4684b23a8c
commit 59b0ed7688
1 changed files with 1 additions and 1 deletions

View File

@ -170,11 +170,11 @@ export default {
const url = `${this.endpoint}/${`api/stats/summary?sid=${encodeURIComponent(this.sessionId)}`.replace(/^\/+/, '')}`;
const response = await fetch(url);
this.status = "enabled";
if (response.ok) {
const result = await response.json();
if (result?.queries?.percent_blocked !== undefined) {
this.status = "enabled";
this.percent_blocked = result.queries.percent_blocked;
this.retryCount = 0;
} else {