Skip to content
Snippets Groups Projects
Commit 98288242 authored by Mahdi Yari's avatar Mahdi Yari
Browse files

fix helper function

parent 31b1436e
No related branches found
No related tags found
1 merge request!7Rebrand hf24
......@@ -998,7 +998,7 @@ Get API version and update `rebranded_api` in config.
Note: this will update the config too based on the result.
```
var apiVersion = hive.utils.autoDetectApiVersion();
var apiVersion = await hive.utils.autoDetectApiVersion();
console.log(apiVersion);
// => { rebranded_api: true }
```
......
......@@ -127,14 +127,13 @@ export function buildWitnessUpdateOp(
return ["witness_set_properties", data];
}
export function autoDetectApiVersion() {
hiveApi.getVersionAsync().then(res => {
if (res.blockchain_version !== "0.23.0") {
config.set("rebranded_api", true)
return { rebranded_api: true }
} else {
config.set("rebranded_api", false)
return { rebranded_api: false }
}
})
export function async autoDetectApiVersion() {
const res = await hiveApi.getVersionAsync()
if (res.blockchain_version !== "0.23.0") {
config.set("rebranded_api", true)
return { rebranded_api: true }
} else {
config.set("rebranded_api", false)
return { rebranded_api: false }
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment