Skip to content

Commit

Permalink
fix: synced header
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Jul 21, 2022
1 parent e501287 commit 6da3d3c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import {
import packageJson from '../package.json';
import datalayer from './datalayer';

const { API_KEY, READ_ONLY, IS_GOVERNANCE_BODY } = getConfig().APP;
const { API_KEY, READ_ONLY, IS_GOVERNANCE_BODY, USE_SIMULATOR } =
getConfig().APP;

const headerKeys = Object.freeze({
API_VERSION_HEADER_KEY: 'x-api-version',
Expand Down Expand Up @@ -102,7 +103,12 @@ app.use(function (req, res, next) {
});

app.use(async function (req, res, next) {
res.setHeader(headerKeys.WALLET_SYNCED, await datalayer.walletIsSynced());
if (USE_SIMULATOR) {
res.setHeader(headerKeys.WALLET_SYNCED, true);
} else {
res.setHeader(headerKeys.WALLET_SYNCED, await datalayer.walletIsSynced());
}

next();
});

Expand Down

0 comments on commit 6da3d3c

Please sign in to comment.