[PB-5819]: feature/auto-restore items#1955
Conversation
Deploying drive-web with
|
| Latest commit: |
efaea00
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://66d4eeac.drive-web.pages.dev |
| Branch Preview URL: | https://refactor-move-items.drive-web.pages.dev |
| await Promise.all( | ||
| restorable.map((item) => { | ||
| dispatch(storageActions.setMoveDestinationFolderId(item.parent?.uuid as string)); | ||
| return processMove({ finalDestinationId: item.parent!.uuid, items: [item] }); | ||
| }), | ||
| ); |
There was a problem hiding this comment.
there is a race condition here as setMoveDestinationFolderId is overwritten in every call, anyway, as processMove receives de finalDestinationId is no need to set setMoveDestinationFolderId i think.
Maybe we can add a test for this case :)
There was a problem hiding this comment.
Yep. But I noticed that the moveDestinationFolderId is used when there are conflicts with the file in the folder we want to move in. destinationFolderId is used for "Name Collision".
Let me think another way so we can avoid the race condition here.
| const dispatch = useAppDispatch(); | ||
| const itemsToMove: DriveItemData[] = useSelector((state: RootState) => state.storage.itemsToMove); | ||
| const processMove = async ({ finalDestinationId, items, displayTaskLogger }: ProcessMoveProps) => { | ||
| const processItems = items ?? itemsToMove; |
There was a problem hiding this comment.
as items is a required field is no need itemsToMove fallback
|



Description
Adding the logic to auto restore items if the parent folder exists. If to, then the "Move items" dialog is opened to select the destination of the items.
Related Issues
Related Pull Requests
Checklist
Testing Process
Additional Notes