Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Return default unknown endpoint type (#3517)
Browse files Browse the repository at this point in the history
  • Loading branch information
KlapTrap authored and richard-cox committed Apr 29, 2019
1 parent 1dd41f7 commit 6978bb1
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,22 @@ export function getEndpointTypes() {
}

export function getEndpointType(type: string, subType: string): EndpointTypeConfig {
return getEndpointTypeByKey(createEndpointKey(type, subType));
return getEndpointTypeByKey(createEndpointKey(type, subType)) || getDefaultEndpointTypeConfig(type, subType);
}

function getEndpointTypeByKey(key: string): EndpointTypeConfig {
return endpointTypesMap[key];
}

function getDefaultEndpointTypeConfig(type: string, subType?: string): EndpointTypeConfig {
return {
label: 'Unknown',
type,
subType,
doesNotSupportConnect: true
};
}

export function getIconForEndpoint(type: string, subType: string): EndpointIcon {
const icon = {
name: 'settings_ethernet',
Expand Down

0 comments on commit 6978bb1

Please sign in to comment.