1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

add version to page events (#9926)

This commit is contained in:
Brad Decker 2020-11-21 09:38:43 -06:00 committed by GitHub
parent f8f3faf539
commit b3fa1e534e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,6 +83,12 @@ export function MetaMetricsProvider({ children }) {
const context = useSegmentContext()
const network = useSelector(getMetricsNetworkIdentifier)
const chainId = useSelector(getCurrentChainId)
// Temporary until the background controller refactor merges:
const baseVersion = global.platform.getVersion()
const version =
process.env.METAMASK_ENVIRONMENT === 'production'
? baseVersion
: `${baseVersion}-${process.env.METAMASK_ENVIRONMENT}`
/**
* track a metametrics event
@ -171,13 +177,17 @@ export function MetaMetricsProvider({ children }) {
network,
environment_type: environmentType,
},
context,
context: {
...context,
version,
},
})
}
previousMatch.current = match?.path
}
}, [
location,
version,
locale,
context,
network,