File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export default {
2424 copySelection: this .t (' bookmkarks' , ' Adding selection to folders' ),
2525 emptyTrashbin: this .t (' bookmkarks' , ' Emptying trashbin' ),
2626 deleted_folders: this .t (' bookmkarks' , ' Loading trashbin' ),
27+ undeleteFolder: this .t (' bookmarks' , ' Restoring folder' ),
2728 },
2829 showNcModal: false ,
2930 showTimeout: null ,
Original file line number Diff line number Diff line change @@ -461,7 +461,7 @@ export default {
461461 if ( oldFolder ) {
462462 const response2 = await axios . delete (
463463 url ( state , `/folder/${ oldFolder } /bookmarks/${ bookmark } ?hardDelete=true` ) ,
464- ) ;
464+ )
465465 if ( response2 . data . status !== 'success' ) {
466466 throw new Error ( response2 . data )
467467 }
@@ -943,6 +943,7 @@ export default {
943943 try {
944944 const parentFolderId = this . getters . getFolder ( id ) [ 0 ] . parent_folder
945945 const parentFolderItem = this . getters . getFolder ( parentFolderId ) [ 0 ]
946+ commit ( mutations . FETCH_START , { type : 'undeleteFolder' } )
946947 const response = await axios . post ( url ( state , `/folder/${ id } /undelete` ) )
947948 const {
948949 data : { status } ,
@@ -958,10 +959,12 @@ export default {
958959 actions . LOAD_FOLDER_CHILDREN_ORDER ,
959960 parentFolderItem ? parentFolderId : '-1' ,
960961 )
961- await dispatch ( actions . LOAD_FOLDERS )
962+ await dispatch ( actions . LOAD_FOLDERS , /* force: */ true )
962963 await dispatch ( actions . LOAD_DELETED_FOLDERS )
963964 }
965+ commit ( mutations . FETCH_END , 'undeleteFolder' )
964966 } catch ( err ) {
967+ commit ( mutations . FETCH_END , 'undeleteFolder' )
965968 console . error ( err )
966969 commit (
967970 mutations . SET_ERROR ,
You can’t perform that action at this time.
0 commit comments