@@ -9,12 +9,6 @@ import { useQuery, useClient } from 'cozy-client'
99import { useVaultClient } from 'cozy-keys-lib'
1010import { useI18n } from 'cozy-ui/transpiled/react/I18n'
1111import useBreakpoints from 'cozy-ui/transpiled/react/hooks/useBreakpoints'
12- import { useWebviewIntent } from 'cozy-intent'
13- import {
14- removeFileToUploadQueue ,
15- uploadFilesFromNative ,
16- purgeUploadQueue
17- } from 'drive/web/modules/upload'
1812import Dropzone from 'drive/web/modules/upload/Dropzone'
1913import { ModalContext } from 'drive/lib/ModalContext'
2014import useActions from 'drive/web/modules/actions/useActions'
@@ -56,6 +50,7 @@ import FabWithMenuContext from 'drive/web/modules/drive/FabWithMenuContext'
5650import AddMenuProvider from 'drive/web/modules/drive/AddMenu/AddMenuProvider'
5751import useHead from 'components/useHead'
5852import { useSelectionContext } from 'drive/web/modules/selection/SelectionProvider'
53+ import { useResumeUploadFromFlagship } from 'drive/web/modules/views/Upload/useUploadFromFlagship'
5954
6055const desktopExtraColumnsNames = [ 'carbonCopy' , 'electronicSafe' ]
6156const mobileExtraColumnsNames = [ ]
@@ -67,7 +62,6 @@ const DriveView = () => {
6762 const currentFolderId = useCurrentFolderId ( ) || ROOT_DIR_ID
6863 useHead ( )
6964 const { isSelectionBarVisible } = useSelectionContext ( )
70- const webviewIntent = useWebviewIntent ( )
7165
7266 const { isMobile } = useBreakpoints ( )
7367 const { isFabDisplayed, setIsFabDisplayed } = useContext ( FabContext )
@@ -179,37 +173,7 @@ const DriveView = () => {
179173 [ t ]
180174 )
181175
182- useEffect ( ( ) => {
183- if ( ! webviewIntent ) return
184-
185- webviewIntent
186- . call ( 'hasFilesToHandle' )
187- . then ( ( { filesToHandle, uploadedFiles, uploading } ) => {
188- if ( ! uploading ) return false
189-
190- actions . dispatch (
191- uploadFilesFromNative (
192- filesToHandle ,
193- displayedFolder ?. id ,
194- undefined ,
195- { client } ,
196- ( ) => Promise . resolve ( )
197- )
198- )
199-
200- return uploadedFiles
201- } )
202- . then ( uploadedFiles => {
203- if ( ! uploadedFiles ) return false
204-
205- return uploadedFiles . forEach ( file => {
206- return actions . dispatch ( removeFileToUploadQueue ( file ) )
207- } )
208- } )
209- . catch ( ( ) => {
210- return actions . dispatch ( purgeUploadQueue ( ) )
211- } )
212- } , [ actions , client , displayedFolder ?. id , webviewIntent ] )
176+ useResumeUploadFromFlagship ( )
213177
214178 useEffect ( ( ) => {
215179 if ( canWriteToCurrentFolder ) {
0 commit comments