mirror of
https://github.com/bastienwirtz/homer.git
synced 2025-11-02 19:35:55 +01:00
set this.status after checking the response is OK
This commit is contained in:
@@ -170,11 +170,11 @@ export default {
|
|||||||
|
|
||||||
const url = `${this.endpoint}/${`api/stats/summary?sid=${encodeURIComponent(this.sessionId)}`.replace(/^\/+/, '')}`;
|
const url = `${this.endpoint}/${`api/stats/summary?sid=${encodeURIComponent(this.sessionId)}`.replace(/^\/+/, '')}`;
|
||||||
const response = await fetch(url);
|
const response = await fetch(url);
|
||||||
this.status = "enabled";
|
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
if (result?.queries?.percent_blocked !== undefined) {
|
if (result?.queries?.percent_blocked !== undefined) {
|
||||||
|
this.status = "enabled";
|
||||||
this.percent_blocked = result.queries.percent_blocked;
|
this.percent_blocked = result.queries.percent_blocked;
|
||||||
this.retryCount = 0;
|
this.retryCount = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user