@@ -71,41 +71,56 @@ const getConnectionModes = (destination) => {
7171 server : false
7272 } ,
7373 }
74- destination . components . forEach ( component => {
75- switch ( component . type ) {
76- case 'IOS' :
77- connectionModes . device . mobile = true
78- break
79- case 'ANDROID' :
80- connectionModes . device . mobile = true
81- break
82- case 'BROWSER' :
83- if ( destination . browserUnbundling ) {
84- connectionModes . cloud . web = true
85- }
86- connectionModes . device . web = true
87- break
88- case 'SERVER' :
89- connectionModes . cloud . mobile = true
90- if ( destination . platforms . server ) {
91- connectionModes . cloud . server = true
92- }
93- if ( destination . platforms . browser ) {
94- connectionModes . cloud . web = true
95- }
96- break
97- case 'CLOUD' :
98- connectionModes . cloud . mobile = true
99- if ( destination . platforms . server ) {
100- connectionModes . cloud . server = true
101- }
102- if ( destination . platforms . browser ) {
103- connectionModes . cloud . web = true
104- }
105- break
10674
75+ // if destination has device specific components
76+ if ( destination . components . length ) {
77+ destination . components . forEach ( component => {
78+ switch ( component . type ) {
79+ case 'IOS' :
80+ connectionModes . device . mobile = true
81+ break
82+ case 'ANDROID' :
83+ connectionModes . device . mobile = true
84+ break
85+ case 'BROWSER' :
86+ if ( destination . browserUnbundling ) {
87+ connectionModes . cloud . web = true
88+ }
89+ connectionModes . device . web = true
90+ break
91+ case 'SERVER' :
92+ connectionModes . cloud . mobile = true
93+ if ( destination . platforms . server ) {
94+ connectionModes . cloud . server = true
95+ }
96+ if ( destination . platforms . browser ) {
97+ connectionModes . cloud . web = true
98+ }
99+ break
100+ case 'CLOUD' :
101+ connectionModes . cloud . mobile = true
102+ if ( destination . platforms . server ) {
103+ connectionModes . cloud . server = true
104+ }
105+ if ( destination . platforms . browser ) {
106+ connectionModes . cloud . web = true
107+ }
108+ break
109+ }
110+ } )
111+ // if destination has no device specific components, check for supported platforms
112+ } else {
113+ if ( destination . platforms . browser ) {
114+ connectionModes . cloud . web = true
107115 }
108- } )
116+ if ( destination . platforms . mobile ) {
117+ connectionModes . cloud . mobile = true
118+ }
119+ if ( destination . platforms . server ) {
120+ connectionModes . cloud . server = true
121+ }
122+ }
123+
109124 return connectionModes
110125}
111126
0 commit comments