File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
components/supervisor/frontend/src Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -108,9 +108,20 @@ const toStop = new DisposableCollection();
108
108
//#region current-frame
109
109
let current : HTMLElement = loading . frame ;
110
110
let desktopRedirected = false ;
111
+ let currentInstanceId = "" ;
111
112
const nextFrame = ( ) => {
112
113
const instance = gitpodServiceClient . info . latestInstance ;
113
114
if ( instance ) {
115
+ // refresh web page when instanceId changed
116
+ if ( currentInstanceId !== "" ) {
117
+ if ( instance . id !== currentInstanceId && instance . ideUrl !== "" ) {
118
+ currentInstanceId = instance . id ;
119
+ window . location . href = instance . ideUrl ;
120
+ return ;
121
+ }
122
+ } else {
123
+ currentInstanceId = instance . id ;
124
+ }
114
125
if ( instance . status . phase === 'running' ) {
115
126
if ( ! hideDesktopIde ) {
116
127
if ( isDesktopIde == undefined ) {
@@ -148,7 +159,7 @@ const toStop = new DisposableCollection();
148
159
}
149
160
const updateCurrentFrame = ( ) => {
150
161
const newCurrent = nextFrame ( ) ;
151
- if ( current === newCurrent ) {
162
+ if ( newCurrent == null || current === newCurrent ) {
152
163
return ;
153
164
}
154
165
current . style . visibility = 'hidden' ;
You can’t perform that action at this time.
0 commit comments