Permalink
Browse files

Optimize version resolving

  • Loading branch information...
schrieveslaach committed Jan 25, 2019
1 parent 881ec9c commit 7549020814850badf640ccdf1bc1e6c0d62012b4
Showing with 6 additions and 1 deletion.
  1. +6 −1 frontend/src/store/index.js
@@ -173,8 +173,13 @@ export default new Vuex.Store( {
return;
}

const undefinedVersion = { 'build.time': 'N/A', 'git.revision': 'N/A' };
if ( container.versionUrl == null ) {
promises.push( Promise.resolve( ( { name, containerIndex, version: undefinedVersion } ) ) );
}

promises.push( fetch( container.versionUrl )
.then( res => res.ok ? res.json() : { 'build.time': 'N/A', 'git.revision': 'N/A' } )
.then( res => res.ok ? res.json() : undefinedVersion )
.then( version => ( { name, containerIndex, version } ) ) );
} );

0 comments on commit 7549020

Please sign in to comment.