File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
app/components/sandbox/Preview Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,12 @@ export default class Preview extends React.PureComponent {
101101 return ;
102102 }
103103
104+ if ( prevProps . externalResources !== this . props . externalResources ) {
105+ // Changed external resources
106+ this . executeCodeImmediately ( ) ;
107+ return ;
108+ }
109+
104110 if ( prevProps . module . id !== this . props . module . id ) {
105111 if ( prevProps . isInProjectView && this . props . isInProjectView ) {
106112 // If user only navigated while watching project
Original file line number Diff line number Diff line change @@ -57,10 +57,10 @@ async function compile(message) {
5757
5858 if ( fetching ) return ;
5959
60+ handleExternalResources ( externalResources ) ;
6061 if ( url == null || url !== newUrl ) {
6162 fetching = true ;
6263 url = newUrl ;
63- handleExternalResources ( externalResources ) ;
6464 await addDependencyBundle ( ) ;
6565 fetching = false ;
6666 window . parent . postMessage ( 'Ready!' , host ) ;
You can’t perform that action at this time.
0 commit comments