From 873df1f36d02281c0e9fa768f0998cb333236b14 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Thu, 11 Sep 2025 17:13:52 +0100 Subject: [PATCH] CLDC-4066: Lint --- .../controllers/address_search_controller.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/frontend/controllers/address_search_controller.js b/app/frontend/controllers/address_search_controller.js index 833bc317f..b3410e49d 100644 --- a/app/frontend/controllers/address_search_controller.js +++ b/app/frontend/controllers/address_search_controller.js @@ -4,10 +4,10 @@ import 'accessible-autocomplete/dist/accessible-autocomplete.min.css' const options = [] -let latestQueryId = 0; +let latestQueryId = 0 const sleep = (ms) => { - return new Promise(resolve => setTimeout(resolve, ms)); + return new Promise(resolve => setTimeout(resolve, ms)) } const fetchOptions = async (query, searchUrl) => { @@ -19,11 +19,11 @@ const fetchOptions = async (query, searchUrl) => { // this is because this API has periods of high latency if OS Places has an outage // making too many requests can overwhelm the number of threads available on the server // which can in turn cause a site wide outage - latestQueryId++; - const myQueryId = latestQueryId; - await sleep(500); + latestQueryId++ + const myQueryId = latestQueryId + await sleep(500) if (myQueryId !== latestQueryId) { - throw new Error('Outdated query, ignoring result.'); + throw new Error('Outdated query, ignoring result.') } try {