From 8c6c8f861d31f3fe910f7f82a01be9538b6cc935 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 12 Nov 2024 00:08:56 -0500 Subject: [PATCH] Automatically re-check for scripts Adding a separate `keepText` field for the `updateBrew()` API might be a bandaid for something that should be looked at more deeply as a separate refactor, considering `updateBrew()` is configured to just return the stub and not the whole document. For now, re-scanning for script tags after updating can be as simple as just re-looking up the brew. --- client/admin/brewUtils/brewLookup/brewLookup.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/admin/brewUtils/brewLookup/brewLookup.jsx b/client/admin/brewUtils/brewLookup/brewLookup.jsx index 7b7fd1b2e..80f08fcf8 100644 --- a/client/admin/brewUtils/brewLookup/brewLookup.jsx +++ b/client/admin/brewUtils/brewLookup/brewLookup.jsx @@ -44,13 +44,13 @@ const BrewLookup = createClass({ }); }, - cleanScript(){ + async cleanScript(){ if(!this.state.foundBrew?.shareId) return; - request.put(`/admin/clean/script/${this.state.foundBrew.shareId}`) - .then((res)=>this.setState({ foundBrew: res.body })) - .catch((err)=>this.setState({ error: err })) - .finally(()=>this.setState({ scriptCount: 0 })); + await request.put(`/admin/clean/script/${this.state.foundBrew.shareId}`) + .catch((err)=>{ this.setState({ error: err }); return; }); + + this.lookup(); }, renderFoundBrew(){