-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update manifest to add acceptFromFlagship
- Also add placeholder route that will handle mobile uploads later
- Loading branch information
Showing
4 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react' | ||
import { useUploadFromFlagship } from './useUploadFromFlagship' | ||
|
||
export const UploadFromFlagship = () => { | ||
const { loading } = useUploadFromFlagship() | ||
|
||
return ( | ||
<div> | ||
<h1>Upload From Flagship Page</h1> | ||
<p>{loading ? 'loading' : 'Ready to call hasFilesToHandle'}</p> | ||
</div> | ||
) | ||
} |
20 changes: 20 additions & 0 deletions
20
src/drive/web/modules/views/Upload/useUploadFromFlagship.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { useSearchParams } from 'react-router-dom' | ||
import { useWebviewIntent } from 'cozy-intent' | ||
import { useEffect, useState } from 'react' | ||
|
||
export const useUploadFromFlagship = () => { | ||
const [loading, setLoading] = useState(true) | ||
const [searchParams] = useSearchParams() | ||
const webviewIntent = useWebviewIntent() | ||
const fromFlagshipUpload = searchParams.get('fromFlagshipUpload') | ||
|
||
useEffect(() => { | ||
if (fromFlagshipUpload && webviewIntent) { | ||
setLoading(false) | ||
} | ||
}, [fromFlagshipUpload, webviewIntent]) | ||
|
||
return { | ||
loading | ||
} | ||
} |