File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
components/interface/client/src
components/ExternalContentPanel Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ export function TabContextProvider({ children }) {
2525 const tabIndex = prevTabs . findIndex ( ( tab ) => tab . url === url ) ;
2626 if ( updatedTabs . length > 0 ) {
2727 const newIndex =
28- tabIndex === 0 ? 0 : Math . min ( tabIndex - 1 , updatedTabs . length - 1 ) ;
28+ tabIndex === 0
29+ ? 0
30+ : Math . min ( tabIndex - 1 , updatedTabs . length - 1 ) ;
2931 return updatedTabs [ newIndex ] . url ;
3032 } else {
3133 return null ;
Original file line number Diff line number Diff line change @@ -23,12 +23,18 @@ export function ExternalContentPanel() {
2323 } }
2424 />
2525 </ div >
26- { activeTab ? (
27- < iframe
28- ref = { iframeRef }
29- style = { { flex : 1 , border : "none" } }
30- src = { activeTab }
31- />
26+ { tabs . length > 0 ? (
27+ < >
28+ { tabs . map ( ( tab ) => (
29+ < iframe
30+ key = { tab . url }
31+ ref = { tab . url === activeTab ? iframeRef : null }
32+ style = { { flex : 1 , border : "none" } }
33+ src = { tab . url }
34+ className = { tab . url === activeTab ? "d-block" : "d-none" }
35+ />
36+ ) ) }
37+ </ >
3238 ) : (
3339 < IdePlaceholder
3440 onLaunch = { ( ) => addTab ( "http://localhost:8085" , "Workspace" ) }
You can’t perform that action at this time.
0 commit comments