forked from mystiq/hydrogen-web
Simplify code
This commit is contained in:
parent
826835e518
commit
c6691cf1cb
1 changed files with 3 additions and 3 deletions
|
@ -125,12 +125,12 @@ async function handleRequest(request) {
|
|||
|
||||
async function handleConfigRequest(request) {
|
||||
let response = await readCache(request);
|
||||
const networkResponsePromise = fetchAndUpdateConfig(request);
|
||||
if (response) {
|
||||
fetchAndUpdateConfig(request);
|
||||
return response;
|
||||
} else {
|
||||
return await networkResponsePromise;
|
||||
}
|
||||
response = await fetchAndUpdateConfig(request);
|
||||
return response;
|
||||
}
|
||||
|
||||
async function fetchAndUpdateConfig(request) {
|
||||
|
|
Loading…
Reference in a new issue