From 93b7e15282f2083fb796eaf7ee54bb636c76a06c Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Mon, 14 Dec 2020 18:39:50 +0100 Subject: [PATCH] Update requests after generation --- src/html/app.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/html/app.js b/src/html/app.js index 7723949a..0a4d9e6a 100644 --- a/src/html/app.js +++ b/src/html/app.js @@ -153,17 +153,18 @@ finally { this.generated.pending = false } + this.ghlimit({once:true}) }, //Serialize svg serialize(svg) { return `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(svg)))}` }, //Update reate limit requests - async ghlimit() { + async ghlimit({once = false} = {}) { const {data:requests} = await axios.get("/.requests") this.requests = requests - setTimeout(() => this.ghlimit(), 30*1000) - console.log("yeh") + if (!once) + setTimeout(() => this.ghlimit(), 30*1000) } }, })