fix(state): ensure API version >= 1.25 before extension check (#1594)

* fix(state): ensure API version >= 1.25 before extension check
pull/1602/head
Anthony Lapenna 7 years ago committed by GitHub
parent 0d0072a50e
commit 362f036a68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -114,15 +114,17 @@ angular.module('portainer.services')
}
$q.all({
info: SystemService.info(),
version: SystemService.version(),
extensions: ExtensionManager.extensions()
version: SystemService.version()
})
.then(function success(data) {
var endpointMode = InfoHelper.determineEndpointMode(data.info);
var endpointAPIVersion = parseFloat(data.version.ApiVersion);
state.endpoint.mode = endpointMode;
state.endpoint.apiVersion = endpointAPIVersion;
state.endpoint.extensions = data.extensions;
return $q.when(endpointAPIVersion < 1.25 || ExtensionManager.extensions());
})
.then(function success(data) {
state.endpoint.extensions = data instanceof Array ? data : [];
LocalStorage.storeEndpointState(state.endpoint);
deferred.resolve();
})

Loading…
Cancel
Save