11/* tslint:disable:no-console*/
2- import { CodeActions , GameLogActions , SubmissionActions } from 'app/actions' ;
2+ import { CodeActions , GameLogActions , NotificationActions , SubmissionActions } from 'app/actions' ;
33import * as SubmissionFetch from 'app/apiFetch/Submission' ;
44import { RootState } from 'app/reducers' ;
55import { checkAccountActivated , checkAuthentication } from 'app/sagas/utils' ;
@@ -11,25 +11,15 @@ export const getSubmissionState = (state: RootState) => state.submission;
1111export const getUserLatestCode = ( state : RootState ) => state . code . code ;
1212
1313export function * lockCode ( action : ActionType < typeof SubmissionActions . lockCode > ) {
14- // try {
15- // const submissionState = yield select(getSubmissionState);
16- // if (submissionState.request !== Request.NONE) return;
17- // yield put(SubmissionActions.updateDebugRunRequest(Request.NONE));
18- // yield put(CodeActions.save());
19- // yield put(NotificationActions.info('Code is being locked...'));
20- // yield put(GameLogActions.clearAllLogs());
21- // yield put(GameLogActions.setHideDebugLog(false));
22- // yield put(
23- // SubmissionActions.changeStateCurrentRequest(
24- // RequestState.COMPILE_CURRENT_CODE,
25- // Request.LOCK_CODE,
26- // '',
27- // 0,
28- // ),
29- // );
30- // } catch (err) {
31- // console.error(err);
32- // }
14+ try {
15+ yield put ( CodeActions . save ( ) ) ;
16+ // @ts -ignore
17+ const res = yield call ( SubmissionFetch . lockCode ) ;
18+ yield put ( NotificationActions . success ( 'Code Locked' ) ) ;
19+ yield put ( GameLogActions . clearAllLogs ( ) ) ;
20+ } catch ( err ) {
21+ console . error ( err ) ;
22+ }
3323}
3424
3525export function * previousCommitMatch (
0 commit comments