Skip to content

Commit

Permalink
feat: snapshot status feature flag (#1277)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncomerci authored Sep 20, 2023
1 parent 89495ce commit b5cc9aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { SEGMENT_KEY, SSO_URL } from "./src/constants"
import { flattenMessages } from "./src/utils/intl"
import en from "./src/intl/en.json"
import SnapshotStatus from "./src/components/Debug/SnapshotStatus"
import SNAPSHOT_STATUS_ENABLED from "./src/constants"

const queryClient = new QueryClient()

Expand All @@ -50,7 +51,7 @@ export const wrapPageElement = ({ element, props }) => {
<IntlProvider defaultLocale='en' locale='en' messages={flattenMessages(en)}>
<IdentityModalContextProvider>
<BurgerMenuStatusContextProvider>
<SnapshotStatus />
{SNAPSHOT_STATUS_ENABLED && <SnapshotStatus />}
<Layout {...props} rightMenu={<Navbar />}>
{element}
</Layout>
Expand Down
5 changes: 4 additions & 1 deletion src/back/jobs/PingSnapshot.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { SNAPSHOT_STATUS_ENABLED } from '../../constants'
import { SnapshotService } from '../../services/SnapshotService'

export async function pingSnapshot() {
await SnapshotService.ping()
if (SNAPSHOT_STATUS_ENABLED) {
await SnapshotService.ping()
}
}
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ export const DEBUG_ADDRESSES = (process.env.DEBUG_ADDRESSES || '')
.split(',')
.filter(isEthereumAddress)
.map((address) => address.toLowerCase())
export const SNAPSHOT_STATUS_ENABLED = false

0 comments on commit b5cc9aa

Please sign in to comment.