dynmic update sdk version

This commit is contained in:
liangping 2023-12-25 09:08:15 +08:00
parent 4fa1391e01
commit fe659f8f61
2 changed files with 10 additions and 1 deletions

View File

@ -41,7 +41,13 @@ export const useBlockchain = defineStore('blockchain', {
},
getters: {
current(): ChainConfig | undefined {
return this.dashboard.chains[this.chainName];
const chain = this.dashboard.chains[this.chainName]
// update chain config with dynamic updated sdk version
const sdkversion = localStorage.getItem(`sdk_version_${this.chainName}`)
if(sdkversion && chain?.versions) {
chain.versions.cosmosSdk = sdkversion;
}
return chain;
},
logo(): string {
return this.current?.logo || '';

View File

@ -193,6 +193,9 @@ export const useParamStore = defineStore('paramstore', {
},
async handleAbciInfo() {
const res = await this.fetchAbciInfo();
localStorage.setItem(`sdk_version_${this.blockchain.chainName}`, res.application_version?.cosmos_sdk_version);
this.appVersion.items = Object.entries(res.application_version).map(
([key, value]) => ({ subtitle: key, value: value })
);