@@ -555,13 +555,13 @@ export function* persistenceSaga(): SagaIterator {
555
555
yield takeEvery (
556
556
PERSISTENCE_SAVE_FILE ,
557
557
function * ( { payload : { id, name } } : ReturnType < typeof actions . persistenceSaveFile > ) {
558
+ yield call ( store . dispatch , actions . disableFileSystemContextMenus ( ) ) ;
558
559
let toastKey : string | undefined ;
559
560
560
561
const [ currFolderObject ] = yield select ( // TODO resolve type here?
561
562
( state : OverallState ) => [
562
563
state . playground . persistenceFile
563
- ]
564
- ) ;
564
+ ] ) ;
565
565
566
566
yield call ( ensureInitialisedAndAuthorised ) ;
567
567
@@ -576,11 +576,6 @@ export function* persistenceSaga(): SagaIterator {
576
576
) ;
577
577
578
578
try {
579
- toastKey = yield call ( showMessage , {
580
- message : `Saving as ${ name } ...` ,
581
- timeout : 0 ,
582
- intent : Intent . PRIMARY
583
- } ) ;
584
579
585
580
if ( activeEditorTabIndex === null ) {
586
581
throw new Error ( 'No active editor tab found.' ) ;
@@ -599,13 +594,25 @@ export function* persistenceSaga(): SagaIterator {
599
594
if ( ! currPersistenceFile ) {
600
595
throw new Error ( 'Persistence file not found' ) ;
601
596
}
597
+ toastKey = yield call ( showMessage , {
598
+ message : `Saving as ${ currPersistenceFile . name } ...` ,
599
+ timeout : 0 ,
600
+ intent : Intent . PRIMARY
601
+ } ) ;
602
602
yield call ( updateFile , currPersistenceFile . id , currPersistenceFile . name , MIME_SOURCE , code , config ) ;
603
603
currPersistenceFile . lastSaved = new Date ( ) ;
604
604
yield put ( actions . addPersistenceFile ( currPersistenceFile ) ) ;
605
- yield call ( showSuccessMessage , `${ name } successfully saved to Google Drive.` , 1000 ) ;
605
+ yield call ( store . dispatch , actions . updateRefreshFileViewKey ( ) ) ;
606
+ yield call ( showSuccessMessage , `${ currPersistenceFile . name } successfully saved to Google Drive.` , 1000 ) ;
606
607
return ;
607
608
}
608
609
610
+ toastKey = yield call ( showMessage , {
611
+ message : `Saving as ${ name } ...` ,
612
+ timeout : 0 ,
613
+ intent : Intent . PRIMARY
614
+ } ) ;
615
+
609
616
yield call ( updateFile , id , name , MIME_SOURCE , code , config ) ;
610
617
yield put ( actions . playgroundUpdatePersistenceFile ( { id, name, lastSaved : new Date ( ) } ) ) ;
611
618
yield call ( showSuccessMessage , `${ name } successfully saved to Google Drive.` , 1000 ) ;
@@ -616,6 +623,7 @@ export function* persistenceSaga(): SagaIterator {
616
623
if ( toastKey ) {
617
624
dismiss ( toastKey ) ;
618
625
}
626
+ yield call ( store . dispatch , actions . enableFileSystemContextMenus ( ) ) ;
619
627
}
620
628
}
621
629
) ;
0 commit comments