diff --git a/src/app/drive/components/DriveExplorer/DriveExplorer.tsx b/src/app/drive/components/DriveExplorer/DriveExplorer.tsx index 5bdd2cb28..e18b825d8 100644 --- a/src/app/drive/components/DriveExplorer/DriveExplorer.tsx +++ b/src/app/drive/components/DriveExplorer/DriveExplorer.tsx @@ -523,8 +523,10 @@ const DriveExplorer = (props: DriveExplorerProps): JSX.Element => { ); const handleOnShareItem = useCallback(() => { - resetPaginationState(); - dispatch(fetchSortedFolderContentThunk(currentFolderId)); + setTimeout(() => { + resetPaginationState(); + dispatch(fetchSortedFolderContentThunk(currentFolderId)); + }, 500); }, [currentFolderId]); const onSuccessEditingName = useCallback(() => { diff --git a/src/app/drive/components/ShareDialog/ShareDialog.tsx b/src/app/drive/components/ShareDialog/ShareDialog.tsx index 2f02157e4..f14a35cf3 100644 --- a/src/app/drive/components/ShareDialog/ShareDialog.tsx +++ b/src/app/drive/components/ShareDialog/ShareDialog.tsx @@ -95,6 +95,7 @@ type ShareDialogProps = { user: UserSettings; isDriveItem?: boolean; onShareItem?: () => void; + onStopSharingItem?: () => void; onCloseDialog?: () => void; }; @@ -463,6 +464,7 @@ const ShareDialog = (props: ShareDialogProps): JSX.Element => { }), ); props.onShareItem?.(); + props.onStopSharingItem?.(); setShowStopSharingConfirmation(false); onClose(); setIsLoading(false); diff --git a/src/app/share/views/SharedLinksView/SharedView.tsx b/src/app/share/views/SharedLinksView/SharedView.tsx index 9cf0480dc..9c5dd5a38 100644 --- a/src/app/share/views/SharedLinksView/SharedView.tsx +++ b/src/app/share/views/SharedLinksView/SharedView.tsx @@ -293,6 +293,7 @@ function SharedView({ : translate('shared-links.toast.link-deleted'); notificationsService.show({ text: stringLinksDeleted, type: ToastType.Success }); closeConfirmDelete(); + actionDispatch(setSelectedItems([])); actionDispatch(setIsLoading(false)); } }; @@ -313,6 +314,8 @@ function SharedView({ })); await moveItemsToTrash(itemsToTrash, () => removeItemsFromList(itemsToTrash)); + + actionDispatch(setSelectedItems([])); }; const renameItem = (shareItem: AdvancedSharedItem | DriveItemData) => { @@ -330,14 +333,14 @@ function SharedView({ const mnemonic = selectedWorkspace?.workspaceUser.key ?? (await decryptMnemonic(shareItem.encryptionKey ? shareItem.encryptionKey : clickedShareItemEncryptionKey)); - handleOpemItemPreview(true, { ...previewItem, mnemonic }); + handleOpenItemPreview(true, { ...previewItem, mnemonic }); } catch (err) { const error = errorService.castError(err); errorService.reportError(error); } }; - const handleOpemItemPreview = (openItemPreview: boolean, item?: PreviewFileItem) => { + const handleOpenItemPreview = (openItemPreview: boolean, item?: PreviewFileItem) => { actionDispatch(setItemToView(item)); actionDispatch(setIsFileViewerOpen(openItemPreview)); }; @@ -465,7 +468,7 @@ function SharedView({ await moveSelectedItemsToTrash(items); if (isFileViewerOpen) { - handleOpemItemPreview(false); + handleOpenItemPreview(false); } }; @@ -536,7 +539,7 @@ function SharedView({ onOpenStopSharingDialog={onOpenStopSharingDialog} onRenameSelectedItem={renameItem} onOpenItemPreview={(item: PreviewFileItem) => { - handleOpemItemPreview(true, item); + handleOpenItemPreview(true, item); }} /> @@ -558,7 +561,7 @@ function SharedView({ handleOpemItemPreview(false)} + onClose={() => handleOpenItemPreview(false)} onShowStopSharingDialog={onOpenStopSharingDialog} sharedKeyboardShortcuts={{ renameItemFromKeyboard: !isCurrentUserViewer(currentUserRole) ? renameItem : undefined, @@ -574,7 +577,10 @@ function SharedView({ moveItemsToTrash={moveItemsToTrashOnStopSharing} /> - + actionDispatch(setSelectedItems([]))} + /> {isShowInvitationsOpen && } 0}