Repository navigation
Fix cold-start file sharing to open Submit expense #101208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nabi-ebrahimi
wants to merge
25
commits into
Expensify:main
Choose a base branch
from
nabi-ebrahimi:fix/cold-start-file-share-submit-expense
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+206
−72
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f2754c7
Fix cold-start file sharing to open Submit expense
nabi-ebrahimi 5d73a7f
Fix duplicate identifier `shouldUseNarrowLayout` in InboxTabSelector
nabi-ebrahimi 1ba8767
Fix unsafe type assertions and lint errors in ShareRootPage
nabi-ebrahimi fc54b29
Move errorTitle early return to top of processFiles callback
nabi-ebrahimi ad46ce4
Restore temporary file cleanup for all file intents
nabi-ebrahimi 1b7804a
Address Android share flow review feedback
nabi-ebrahimi 1efe977
Show an error when shared attachments cannot be saved
nabi-ebrahimi eb89508
Prefer intent MIME type for shared attachments
nabi-ebrahimi 4a54e40
Avoid blocking preference cleanup during share startup
nabi-ebrahimi 8c6a181
Add tests for shared file response handling
nabi-ebrahimi 1b8bc19
Merge branch 'main' into fix/cold-start-file-share-submit-expense
nabi-ebrahimi 7338c12
Merge branch 'main' into fix/cold-start-file-share-submit-expense
nabi-ebrahimi 9fc9e9f
Restore existing Android share temp directory
nabi-ebrahimi 140dbc3
Merge branch 'main' into fix/cold-start-file-share-submit-expense
nabi-ebrahimi 700258b
Rename Android share intent helpers
nabi-ebrahimi 502408f
Clarify Android share intent launch behavior
nabi-ebrahimi 05beba0
Simplify shared file extension fallback
nabi-ebrahimi a913dee
Simplify cold share intent handling
nabi-ebrahimi c00bb00
Initialize splash before processing cold shares
nabi-ebrahimi d74d002
Narrow shared file callback type
nabi-ebrahimi c072f9e
Use intent MIME type for shared attachments
nabi-ebrahimi 716d4da
Remove unused text share save results
nabi-ebrahimi b7310c7
Merge branch 'main' into fix/cold-start-file-share-submit-expense
nabi-ebrahimi 282abeb
fix(share): remove manual memoization from share root
nabi-ebrahimi f89c9bf
Merge branch 'main' into fix/cold-start-file-share-submit-expense
nabi-ebrahimi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,33 @@ | ||
| import type {ShareTempFile} from '@src/types/onyx'; | ||
|
|
||
| function isShareTempFile(file: unknown): file is ShareTempFile { | ||
| return typeof file === 'object' && file !== null && 'id' in file && typeof file.id === 'string' && 'content' in file && typeof file.content === 'string'; | ||
| } | ||
|
|
||
| function getShareTempFile(processedFiles: unknown): ShareTempFile | undefined { | ||
| if (Array.isArray(processedFiles)) { | ||
| const first: unknown = processedFiles.at(0); | ||
| return isShareTempFile(first) ? first : undefined; | ||
| } | ||
|
|
||
| if (isShareTempFile(processedFiles)) { | ||
| return processedFiles; | ||
| } | ||
|
|
||
| if (typeof processedFiles !== 'string' || processedFiles.trim().length === 0) { | ||
| return undefined; | ||
| } | ||
|
|
||
| try { | ||
| const parsed: unknown = JSON.parse(processedFiles); | ||
| return isShareTempFile(parsed) ? parsed : undefined; | ||
| } catch { | ||
| return undefined; | ||
| } | ||
| } | ||
|
|
||
| function normalizeShareFileMimeType(mimeType: string | undefined): string { | ||
| return mimeType?.split(';')[0]?.trim()?.toLowerCase() ?? ''; | ||
| } | ||
|
|
||
| export {getShareTempFile, normalizeShareFileMimeType}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.