@@ -168,23 +168,31 @@ export const WorkspaceSchedulePage: React.FC = () => {
168
168
if ( ! username || ! workspaceName ) {
169
169
navigate ( "/workspaces" )
170
170
return null
171
- } else if (
171
+ }
172
+
173
+ if (
172
174
scheduleState . matches ( "idle" ) ||
173
175
scheduleState . matches ( "gettingWorkspace" ) ||
174
176
scheduleState . matches ( "gettingPermissions" ) ||
175
177
! workspace
176
178
) {
177
179
return < FullScreenLoader />
178
- } else if ( scheduleState . matches ( "error" ) ) {
180
+ }
181
+
182
+ if ( scheduleState . matches ( "error" ) ) {
179
183
return (
180
184
< ErrorSummary
181
185
error = { getWorkspaceError || checkPermissionsError }
182
186
retry = { ( ) => scheduleSend ( { type : "GET_WORKSPACE" , username, workspaceName } ) }
183
187
/>
184
188
)
185
- } else if ( ! permissions ?. updateWorkspace ) {
189
+ }
190
+
191
+ if ( ! permissions ?. updateWorkspace ) {
186
192
return < ErrorSummary error = { Error ( Language . forbiddenError ) } />
187
- } else if ( scheduleState . matches ( "presentForm" ) || scheduleState . matches ( "submittingSchedule" ) ) {
193
+ }
194
+
195
+ if ( scheduleState . matches ( "presentForm" ) || scheduleState . matches ( "submittingSchedule" ) ) {
188
196
return (
189
197
< WorkspaceScheduleForm
190
198
fieldErrors = { formErrors }
@@ -202,13 +210,15 @@ export const WorkspaceSchedulePage: React.FC = () => {
202
210
} }
203
211
/>
204
212
)
205
- } else if ( scheduleState . matches ( "submitSuccess" ) ) {
213
+ }
214
+
215
+ if ( scheduleState . matches ( "submitSuccess" ) ) {
206
216
navigate ( `/@${ username } /${ workspaceName } ` )
207
217
return < FullScreenLoader />
208
- } else {
209
- // Theoretically impossible - log and bail
210
- console . error ( "WorkspaceSchedulePage: unknown state :: " , scheduleState )
211
- navigate ( "/" )
212
- return null
213
218
}
219
+
220
+ // Theoretically impossible - log and bail
221
+ console . error ( "WorkspaceSchedulePage: unknown state :: " , scheduleState )
222
+ navigate ( "/" )
223
+ return null
214
224
}
0 commit comments