From 6ab5dbbd7dc0dce7522190d8019722f56901e03a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20S=C3=A1?= Date: Mon, 4 Jul 2022 18:14:43 +0100 Subject: [PATCH] fix: always send `areThereAvailablePromoCodes` This field is not covered by the version of the `user_config` table. --- lib/graphql/resolvers.js | 6 +++--- lib/graphql/types.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/graphql/resolvers.js b/lib/graphql/resolvers.js index eb1988d8..9c72d5db 100644 --- a/lib/graphql/resolvers.js +++ b/lib/graphql/resolvers.js @@ -96,7 +96,6 @@ const staticConfig = ({ currentConfigVersion, deviceId, deviceName, pq, settings const staticConf = _.flow( _.pick([ - 'areThereAvailablePromoCodes', 'coins', 'configVersion', 'timezone' @@ -171,7 +170,7 @@ const dynamicConfig = ({ deviceId, operatorId, pid, pq, settings, }) => { state.pids = _.update(operatorId, _.set(deviceId, { pid, ts: Date.now() }), state.pids) return _.flow( - _.pick(['balances', 'cassettes', 'coins', 'rates']), + _.pick(['areThereAvailablePromoCodes', 'balances', 'cassettes', 'coins', 'rates']), _.update('cassettes', massageCassettes), @@ -186,7 +185,8 @@ const dynamicConfig = ({ deviceId, operatorId, pid, pq, settings, }) => { /* Group the separate objects by cryptoCode */ /* { balances, coins, rates } => { cryptoCode: { balance, ask, bid, cashIn, cashOut }, ... } */ - ({ balances, cassettes, coins, rates }) => ({ + ({ areThereAvailablePromoCodes, balances, cassettes, coins, rates }) => ({ + areThereAvailablePromoCodes, cassettes, coins: _.flow( _.reduce( diff --git a/lib/graphql/types.js b/lib/graphql/types.js index 1a74179a..92126887 100644 --- a/lib/graphql/types.js +++ b/lib/graphql/types.js @@ -86,7 +86,6 @@ type Terms { type StaticConfig { configVersion: Int! - areThereAvailablePromoCodes: Boolean! coins: [Coin!]! enablePaperWalletOnly: Boolean! hasLightning: Boolean! @@ -137,6 +136,7 @@ type Cassettes { } type DynamicConfig { + areThereAvailablePromoCodes: Boolean! cassettes: Cassettes coins: [DynamicCoinValues!]! reboot: Boolean!