1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

get versions on each rerender

This commit is contained in:
Jernej Pregelj 2019-07-16 12:16:16 +02:00
parent 3a72470208
commit b09c15ff1b

View File

@ -79,15 +79,15 @@ export default class VersionNumbers extends PureComponent<
// for canceling axios requests
public signal = axios.CancelToken.source()
public async componentDidMount() {
this.getOceanVersions()
this.getFaucetVersion()
}
public componentWillUnmount() {
this.signal.cancel()
}
public componentWillReceiveProps() {
this.getOceanVersions()
this.getFaucetVersion()
}
private async getOceanVersions() {
const { ocean } = this.context
// wait until ocean object is properly populated