Repository navigation
Undo defaults values for onyx ids PureReportActionItem #55536
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
Changes from all commits
aaee1f0
66b127b
07ad5f1
7acaffb
b5213ef
cef24c6
f855fe9
c51d608
98566a1
e9f4936
84d6eb5
3e1a2dc
7b468bc
5a808ec
90a9438
1648be5
64f7c01
f598ca7
968912b
e6bbf3a
b4870ba
276ed0b
1ab69c3
6479ec5
2305ac7
8eb529d
1f1a7e1
778ad98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| import {createContext} from 'react'; | ||
|
|
||
| type MentionReportContextProps = { | ||
| currentReportID: string; | ||
| currentReportID: string | undefined; | ||
| exactlyMatch?: boolean; | ||
| }; | ||
|
|
||
| const MentionReportContext = createContext<MentionReportContextProps>({ | ||
| currentReportID: '', | ||
| currentReportID: undefined, | ||
| }); | ||
|
|
||
| export default MentionReportContext; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,9 +60,9 @@ function MentionReportRenderer({style, tnode, TDefaultRenderer, ...defaultRender | |
| const [reports] = useOnyx(ONYXKEYS.COLLECTION.REPORT); | ||
|
|
||
| const currentReportID = useCurrentReportID(); | ||
| const currentReportIDValue = currentReportIDContext || currentReportID?.currentReportID; | ||
| // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this can be removed
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should leave it if
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I meant the Looks like it was just slow, let's keep it then. |
||
| const [currentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${currentReportIDValue || -1}`); | ||
| const currentReportIDValue = currentReportIDContext || currentReportID?.currentReportID; | ||
| const [currentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${currentReportIDValue}`); | ||
|
|
||
| // When we invite someone to a room they don't have the policy object, but we still want them to be able to see and click on report mentions, so we only check if the policyID in the report is from a workspace | ||
| const isGroupPolicyReport = useMemo(() => currentReport && !isEmptyObject(currentReport) && !!currentReport.policyID && currentReport.policyID !== CONST.POLICY.ID_FAKE, [currentReport]); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.