File tree Expand file tree Collapse file tree 2 files changed +25
-9
lines changed
ui/packages/shared/pages/Instance Expand file tree Collapse file tree 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) => {
102102 isPlatform ? < PlatformTabs { ...props } /> : < Tabs { ...props } />
103103
104104 useEffect ( ( ) => {
105- load ( instanceId )
105+ load ( instanceId , isPlatform )
106106 } , [ instanceId ] )
107107
108108 useEffect ( ( ) => {
@@ -133,7 +133,7 @@ export const Instance = observer((props: Props) => {
133133 className = { classes . title }
134134 rightContent = {
135135 < Button
136- onClick = { ( ) => load ( props . instanceId ) }
136+ onClick = { ( ) => load ( props . instanceId , isPlatform ) }
137137 isDisabled = { ! instance && ! instanceError }
138138 className = { classes . reloadButton }
139139 >
Original file line number Diff line number Diff line change @@ -102,24 +102,40 @@ export class MainStore {
102102 return this . instance . state ?. status . code === 'NO_RESPONSE'
103103 }
104104
105- load = ( instanceId : string ) => {
105+ load = ( instanceId : string , isPlatform : boolean = false ) => {
106106 this . instance = null
107107 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+
109122 this . loadInstance ( instanceId , false ) . then ( ( ) => {
110123 if (
111124 ( this . instance ?. createdAt && this . instance ?. url ) ||
112125 ! this . instance ?. createdAt
113126 ) {
114127 this . snapshots . load ( instanceId )
115128 }
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 ( )
121133 }
122134 } )
135+
136+ if ( ! isPlatform ) {
137+ runRetrieval ( )
138+ }
123139 }
124140
125141 reload = ( instanceId : string ) => {
You can’t perform that action at this time.
0 commit comments