File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export function EditorPage() {
3838 updateScene,
3939 loadingPreview,
4040 loadingPublish,
41- isInstalling ,
41+ isInstallingProject ,
4242 } = useEditor ( ) ;
4343 const userId = useSelector ( state => state . analytics . userId ) ;
4444 const iframeRef = useRef < ReturnType < typeof initRpc > > ( ) ;
@@ -168,17 +168,17 @@ export function EditorPage() {
168168 </ Button >
169169 < Button
170170 color = "secondary"
171- disabled = { loadingPreview || isInstalling }
171+ disabled = { loadingPreview || isInstallingProject }
172172 onClick = { openPreview }
173- startIcon = { ( loadingPreview || isInstalling ) ? < Loader size = { 20 } /> : < PlayCircleIcon /> }
173+ startIcon = { loadingPreview ? < Loader size = { 20 } /> : < PlayCircleIcon /> }
174174 >
175175 { t ( 'editor.header.actions.preview' ) }
176176 </ Button >
177177 < Button
178178 color = "primary"
179- disabled = { loadingPublish || isInstalling }
179+ disabled = { loadingPublish || isInstallingProject }
180180 onClick = { handleOpenModal ( 'publish' ) }
181- startIcon = { ( loadingPublish || isInstalling ) ? < Loader size = { 20 } /> : < PublicIcon /> }
181+ startIcon = { loadingPublish ? < Loader size = { 20 } /> : < PublicIcon /> }
182182 >
183183 { t ( 'editor.header.actions.publish' ) }
184184 </ Button >
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ export type EditorState = {
2828 loadingPreview : boolean ;
2929 isInstalling : boolean ;
3030 isInstalled : boolean ;
31+ isInstallingProject : boolean ;
32+ isInstalledProject : boolean ;
3133 isFetchingVersion : boolean ;
3234 error : Error | null ;
3335} ;
@@ -41,6 +43,8 @@ const initialState: EditorState = {
4143 loadingInspector : false ,
4244 loadingPreview : false ,
4345 isInstalling : false ,
46+ isInstallingProject : false ,
47+ isInstalledProject : false ,
4448 isInstalled : false ,
4549 isFetchingVersion : false ,
4650 error : null ,
@@ -139,6 +143,13 @@ export const slice = createSlice({
139143 builder . addCase ( workspaceActions . saveAndGetThumbnail . pending , state => {
140144 if ( state . project ) state . project . status = 'loading' ;
141145 } ) ;
146+ builder . addCase ( workspaceActions . installProject . pending , ( state ) => {
147+ state . isInstallingProject = true ;
148+ } ) ;
149+ builder . addCase ( workspaceActions . installProject . fulfilled , ( state ) => {
150+ state . isInstalledProject = true ;
151+ state . isInstallingProject = false ;
152+ } ) ;
142153 builder . addCase ( workspaceActions . saveAndGetThumbnail . fulfilled , ( state , action ) => {
143154 if ( state . project ) {
144155 state . project . thumbnail = action . payload ;
You can’t perform that action at this time.
0 commit comments