File tree 2 files changed +25
-9
lines changed
ui/packages/shared/pages/Instance
2 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ export const Instance = observer((props: Props) => {
102
102
isPlatform ? < PlatformTabs { ...props } /> : < Tabs { ...props } />
103
103
104
104
useEffect ( ( ) => {
105
- load ( instanceId )
105
+ load ( instanceId , isPlatform )
106
106
} , [ instanceId ] )
107
107
108
108
useEffect ( ( ) => {
@@ -133,7 +133,7 @@ export const Instance = observer((props: Props) => {
133
133
className = { classes . title }
134
134
rightContent = {
135
135
< Button
136
- onClick = { ( ) => load ( props . instanceId ) }
136
+ onClick = { ( ) => load ( props . instanceId , isPlatform ) }
137
137
isDisabled = { ! instance && ! instanceError }
138
138
className = { classes . reloadButton }
139
139
>
Original file line number Diff line number Diff line change @@ -102,24 +102,40 @@ export class MainStore {
102
102
return this . instance . state ?. status . code === 'NO_RESPONSE'
103
103
}
104
104
105
- load = ( instanceId : string ) => {
105
+ load = ( instanceId : string , isPlatform : boolean = false ) => {
106
106
this . instance = null
107
107
this . isReloadingInstance = true
108
- this . getBranches ( instanceId )
108
+
109
+ if ( ! isPlatform ) {
110
+ this . getBranches ( instanceId )
111
+ }
112
+
113
+ const runRetrieval = ( ) => {
114
+ this . loadInstanceRetrieval ( instanceId ) . then ( ( ) => {
115
+ if ( this . instanceRetrieval ) {
116
+ this . getConfig ( instanceId )
117
+ this . getFullConfig ( instanceId )
118
+ }
119
+ } )
120
+ }
121
+
109
122
this . loadInstance ( instanceId , false ) . then ( ( ) => {
110
123
if (
111
124
( this . instance ?. createdAt && this . instance ?. url ) ||
112
125
! this . instance ?. createdAt
113
126
) {
114
127
this . snapshots . load ( instanceId )
115
128
}
116
- } )
117
- this . loadInstanceRetrieval ( instanceId ) . then ( ( ) => {
118
- if ( this . instanceRetrieval ) {
119
- this . getConfig ( instanceId )
120
- this . getFullConfig ( instanceId )
129
+
130
+ if ( isPlatform && this . instance ?. url ) {
131
+ this . getBranches ( instanceId )
132
+ runRetrieval ( )
121
133
}
122
134
} )
135
+
136
+ if ( ! isPlatform ) {
137
+ runRetrieval ( )
138
+ }
123
139
}
124
140
125
141
reload = ( instanceId : string ) => {
You can’t perform that action at this time.
0 commit comments