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