File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,7 +118,9 @@ <h2>Trip information</h2>
118118 if ( ! code ) {
119119 showError ( "❗ No code in URL provided. Example: ?code=abc123" ) ;
120120 } else {
121- fetch ( `/trips/${ code } ` )
121+ const baseUrl = document . location . protocol === 'https:' ? 'https://api.evnotify.de' : '' ;
122+
123+ fetch ( `${ baseUrl } /trips/${ code } ` )
122124 . then ( ( res ) => {
123125 if ( ! res . ok ) {
124126 throw new Error ( ) ;
@@ -130,7 +132,7 @@ <h2>Trip information</h2>
130132 hideError ( ) ;
131133 updateSidebarBasicInfo ( data ) ;
132134
133- return fetch ( `/trips/${ code } /info` )
135+ return fetch ( `${ baseUrl } /trips/${ code } /info` )
134136 . then ( ( res ) => {
135137 if ( ! res . ok ) {
136138 throw new Error ( ) ;
@@ -140,7 +142,6 @@ <h2>Trip information</h2>
140142 } )
141143 } )
142144 . then ( ( data ) => {
143- console . log ( data ) ;
144145 hideError ( ) ;
145146 updateSidebarMetadataAndChargingStops ( data ) ;
146147 } )
@@ -153,7 +154,6 @@ <h2>Trip information</h2>
153154 } ) ;
154155
155156 socket . on ( `route-update:${ code } ` , ( payload ) => {
156- console . log ( payload ) ;
157157 const lat = payload . data . latitude ;
158158 const lng = payload . data . longitude ;
159159
You can’t perform that action at this time.
0 commit comments