File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
app/preprints/-components/submit/preprint-state-machine Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -213,22 +213,21 @@ export default class PreprintStateMachine extends Component<StateMachineArgs>{
213
213
@waitFor
214
214
public async onSubmit ( ) : Promise < void > {
215
215
this . args . resetPageDirty ( ) ;
216
- if ( ! this . isEditFlow ) {
217
- if ( this . provider . reviewsWorkflow ) {
218
- const reviewAction = this . store . createRecord ( 'review-action' , {
219
- actionTrigger : 'submit' ,
220
- target : this . preprint ,
221
- } ) ;
222
- await reviewAction . save ( ) ;
223
- } else {
224
- this . preprint . isPublished = true ;
225
- await this . preprint . save ( ) ;
226
- }
227
216
217
+ if ( this . preprint . reviewsState === ReviewsState . ACCEPTED ) {
218
+ await this . preprint . save ( ) ;
219
+ } else if ( this . provider . reviewsWorkflow ) {
220
+ const reviewAction = this . store . createRecord ( 'review-action' , {
221
+ actionTrigger : 'submit' ,
222
+ target : this . preprint ,
223
+ } ) ;
224
+ await reviewAction . save ( ) ;
225
+ } else {
226
+ this . preprint . isPublished = true ;
227
+ await this . preprint . save ( ) ;
228
228
}
229
229
230
230
await this . preprint . reload ( ) ;
231
-
232
231
await this . router . transitionTo ( 'preprints.detail' , this . provider . id , this . preprint . id ) ;
233
232
}
234
233
You can’t perform that action at this time.
0 commit comments