Просмотр исходного кода

Unselect files before deleting (#26810)

GitOrigin-RevId: 6bf22bc4983c96b7e2b45067aa0970c7fea293e2
Domagoj Kriskovic 1 год назад
Родитель
Сommit
d57d0ca738

+ 4 - 0
services/web/frontend/js/features/file-tree/components/modals/file-tree-modal-delete.jsx

@@ -9,6 +9,7 @@ import OLModal, {
 } from '@/features/ui/components/ol/ol-modal'
 } from '@/features/ui/components/ol/ol-modal'
 import OLButton from '@/features/ui/components/ol/ol-button'
 import OLButton from '@/features/ui/components/ol/ol-button'
 import OLNotification from '@/features/ui/components/ol/ol-notification'
 import OLNotification from '@/features/ui/components/ol/ol-notification'
+import { useFileTreeSelectable } from '../../contexts/file-tree-selectable'
 
 
 function FileTreeModalDelete() {
 function FileTreeModalDelete() {
   const { t } = useTranslation()
   const { t } = useTranslation()
@@ -22,6 +23,8 @@ function FileTreeModalDelete() {
     error,
     error,
   } = useFileTreeActionable()
   } = useFileTreeActionable()
 
 
+  const { select } = useFileTreeSelectable()
+
   if (!isDeleting) return null // the modal will not be rendered; return early
   if (!isDeleting) return null // the modal will not be rendered; return early
 
 
   function handleHide() {
   function handleHide() {
@@ -29,6 +32,7 @@ function FileTreeModalDelete() {
   }
   }
 
 
   function handleDelete() {
   function handleDelete() {
+    select([])
     finishDeleting()
     finishDeleting()
   }
   }