fix: failed to load the bind node

This commit is contained in:
jsers 2020-03-19 11:31:59 +08:00
parent 91a4648c6f
commit feed1df8ca
1 changed files with 4 additions and 1 deletions

View File

@ -76,7 +76,10 @@ class index extends Component<Props, State> {
processData = async (endpoints: Endpoint[]) => {
if (this.state.displayBindNode && endpoints) {
const idents = _.map(endpoints, item => item.ident);
const endpointNodes = await request(`${api.endpoint}s/bindings?idents=${_.join(idents, ',')}`);
let endpointNodes: any[] = [];
if (idents.length) {
endpointNodes = await request(`${api.endpoint}s/bindings?idents=${_.join(idents, ',')}`);
}
const newEndpoints = _.map(endpoints, (item) => {
const current = _.find(endpointNodes, { ident: item.ident });
const nodes = _.get(current, 'nodes', []);