File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -138,8 +138,14 @@ export function App() {
138138 useEffect ( ( ) => {
139139 if ( window . parent !== window ) {
140140 console . warn ( "Warp Charger is running in an iframe, closing window" ) ;
141- const errorMessage = t ( "iframe.error_message" ) ;
142- window . parent . postMessage ( { type : "error" , message : errorMessage } , "*" ) ;
141+ const errorMessage : Message = {
142+ type : MessageType . Error ,
143+ data : {
144+ translation : "iframe.error_message" ,
145+ format : { }
146+ }
147+ } ;
148+ window . parent . postMessage ( errorMessage , "*" ) ;
143149 return ;
144150 }
145151 refresh_access_token ( ) ;
Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ class VirtualNetworkInterface {
7878 }
7979
8080 private handleErrorMessage ( msg : Message ) {
81+ if ( msg . type !== MessageType . Error ) {
82+ console . error ( "handleErrorMessage called with non-error message" , msg ) ;
83+ return ;
84+ }
8185 const data = msg . data as { translation : string , format ?: Record < string , unknown > } ;
8286 showAlert ( i18n . t ( data . translation , data . format ) as string , "danger" ) ;
8387 this . route ( "/devices" ) ;
You can’t perform that action at this time.
0 commit comments