Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ This is a checklist for PR authors. Please make sure to complete all tasks and c
- [ ] iOS: mWeb Safari
- [ ] MacOS: Chrome / Safari
- [ ] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
- [ ] I verified there are no new alerts related to the `canBeMissing` param for `useOnyx`
- [ ] I followed proper code patterns (see [Reviewing the code](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md#reviewing-the-code))
- [ ] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. `toggleReport` and not `onIconClick`)
- [ ] I verified that comments were added to code that is not self explanatory
Expand Down
1 change: 0 additions & 1 deletion contributingGuides/REVIEWER_CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
- [ ] iOS: mWeb Safari
- [ ] MacOS: Chrome / Safari
- [ ] If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
- [ ] I verified there are no new alerts related to the `canBeMissing` param for `useOnyx`
- [ ] I verified proper code patterns were followed (see [Reviewing the code](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md#reviewing-the-code))
- [ ] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. `toggleReport` and not `onIconClick`).
- [ ] I verified that comments were added to code that is not self explanatory
Expand Down
22 changes: 0 additions & 22 deletions contributingGuides/philosophies/ONYX-DATA-MANAGEMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ This is how the application manages all the data stored in Onyx.
- **Actions** - The files stored in `/src/libs/actions`
- **Derived Values** - Special Onyx keys containing values computed from other Onyx values
- **Collections** - Multiple related data objects stored as individual keys with IDs
- **canBeMissing** - Parameter indicating whether a component expects Onyx data to be present

## Rules
### - Actions MUST be the only means to write or read data from the server
Expand Down Expand Up @@ -126,24 +125,3 @@ compute: ([reports, personalDetails]) => {
- Explain the purpose and dependencies
- Document any special cases or performance considerations
- Include type annotations for better developer experience

## canBeMissing Parameter

The `canBeMissing` parameter indicates whether a component connecting to Onyx expects the data to be present or if it can handle missing data gracefully.

### - Components MUST use the `canBeMissing` parameter appropriately
This parameter was added because in some places we are assuming some data will be there, but actually we never load it, which leads to hard to debug bugs.

The linter error exists until we add the param to all callers. Once that happens we can make the param mandatory and remove the linter.

### - `canBeMissing` SHOULD be set to `false` when data is guaranteed to be present
The main criteria for setting `canBeMissing` to `false`:

- **Data is always loaded before component renders**: If the data is always ensured to be loaded before this component renders, then `canBeMissing` SHOULD be set to `false`
- **Always returned by OpenApp**: Any data that is always returned by `OpenApp` used in a component where we have a user (so not in the homepage for example) will have `canBeMissing` set to `false`
- **User always has data**: Maybe we always try to load a piece of data, but the data can be missing/empty, in this case `canBeMissing` would be set to `false`

### - `canBeMissing` SHOULD be set to `true` for potentially missing data
If neither of the above conditions apply, then the param SHOULD probably be `true`, but additionally we MUST make sure that the code using the data manages correctly the fact that the data might be missing.

Context: [Slack discussion](https://expensify.slack.com/archives/C03TQ48KC/p1741208342513379)
1 change: 0 additions & 1 deletion eslint.changed.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const config = defineConfig([
rules: {
'@typescript-eslint/no-deprecated': 'error',
'rulesdir/no-default-id-values': 'error',
'rulesdir/provide-canBeMissing-in-useOnyx': 'error',
'rulesdir/no-unstable-hook-defaults': 'error',
'no-restricted-syntax': [
'error',
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
"react-native-localize": "^3.5.4",
"react-native-nitro-modules": "0.29.4",
"react-native-nitro-sqlite": "9.2.0",
"react-native-onyx": "3.0.35",
"react-native-onyx": "3.0.38",
"react-native-pager-view": "8.0.0",
"react-native-pdf": "7.0.2",
"react-native-performance": "^6.0.0",
Expand Down
44 changes: 18 additions & 26 deletions src/Expensify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ import {hasAuthToken} from './libs/actions/Session';
import * as User from './libs/actions/User';
import * as ActiveClientManager from './libs/ActiveClientManager';
import {isSafari} from './libs/Browser';
import * as Environment from './libs/Environment/Environment';
import FS from './libs/Fullstory';
import Growl, {growlRef} from './libs/Growl';
import {growlRef} from './libs/Growl';
import Log from './libs/Log';
import migrateOnyx from './libs/migrateOnyx';
import Navigation from './libs/Navigation/Navigation';
Expand All @@ -62,13 +61,6 @@ Onyx.registerLogger(({level, message, parameters}) => {
if (level === 'alert') {
Log.alert(message, parameters);
console.error(message);

// useOnyx() calls with "canBeMissing" config set to false will display a visual alert in dev environment
// when they don't return data.
const shouldShowAlert = typeof parameters === 'object' && !Array.isArray(parameters) && 'showAlert' in parameters && 'key' in parameters;
if (Environment.isDevelopment() && shouldShowAlert) {
Growl.error(`${message} Key: ${parameters.key as string}`, 10000);
}
} else if (level === 'hmmm') {
Log.hmmm(message, parameters);
} else {
Expand Down Expand Up @@ -106,24 +98,24 @@ function Expensify() {
const {setSplashScreenState} = useSplashScreenActions();
const [hasAttemptedToOpenPublicRoom, setAttemptedToOpenPublicRoom] = useState(false);
const {translate, preferredLocale} = useLocalize();
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
const [session, sessionMetadata] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: true});
const [lastRoute] = useOnyx(ONYXKEYS.LAST_ROUTE, {canBeMissing: true});
const [userMetadata] = useOnyx(ONYXKEYS.USER_METADATA, {canBeMissing: true});
const [isCheckingPublicRoom = true] = useOnyx(ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, {initWithStoredValues: false, canBeMissing: true});
const [updateAvailable] = useOnyx(ONYXKEYS.UPDATE_AVAILABLE, {initWithStoredValues: false, canBeMissing: true});
const [updateRequired] = useOnyx(ONYXKEYS.UPDATE_REQUIRED, {initWithStoredValues: false, canBeMissing: true});
const [isSidebarLoaded] = useOnyx(ONYXKEYS.IS_SIDEBAR_LOADED, {canBeMissing: true});
const [screenShareRequest] = useOnyx(ONYXKEYS.SCREEN_SHARE_REQUEST, {canBeMissing: true});
const [lastVisitedPath] = useOnyx(ONYXKEYS.LAST_VISITED_PATH, {canBeMissing: true});
const [allReports] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {canBeMissing: false});
const [hasLoadedApp] = useOnyx(ONYXKEYS.HAS_LOADED_APP, {canBeMissing: true});
const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP, {canBeMissing: true});
const [account] = useOnyx(ONYXKEYS.ACCOUNT);
const [session, sessionMetadata] = useOnyx(ONYXKEYS.SESSION);
const [lastRoute] = useOnyx(ONYXKEYS.LAST_ROUTE);
const [userMetadata] = useOnyx(ONYXKEYS.USER_METADATA);
const [isCheckingPublicRoom = true] = useOnyx(ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, {initWithStoredValues: false});
const [updateAvailable] = useOnyx(ONYXKEYS.UPDATE_AVAILABLE, {initWithStoredValues: false});
const [updateRequired] = useOnyx(ONYXKEYS.UPDATE_REQUIRED, {initWithStoredValues: false});
const [isSidebarLoaded] = useOnyx(ONYXKEYS.IS_SIDEBAR_LOADED);
const [screenShareRequest] = useOnyx(ONYXKEYS.SCREEN_SHARE_REQUEST);
const [lastVisitedPath] = useOnyx(ONYXKEYS.LAST_VISITED_PATH);
const [allReports] = useOnyx(ONYXKEYS.COLLECTION.REPORT);
const [hasLoadedApp] = useOnyx(ONYXKEYS.HAS_LOADED_APP);
const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP);
const {isOffline} = useNetwork();
const [stashedCredentials = CONST.EMPTY_OBJECT] = useOnyx(ONYXKEYS.STASHED_CREDENTIALS, {canBeMissing: true});
const [stashedSession] = useOnyx(ONYXKEYS.STASHED_SESSION, {canBeMissing: true});
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {canBeMissing: true});
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID, {canBeMissing: true});
const [stashedCredentials = CONST.EMPTY_OBJECT] = useOnyx(ONYXKEYS.STASHED_CREDENTIALS);
const [stashedSession] = useOnyx(ONYXKEYS.STASHED_SESSION);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);

useDebugShortcut();
usePriorityMode();
Expand Down
2 changes: 1 addition & 1 deletion src/HybridAppHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import isLoadingOnyxValue from './types/utils/isLoadingOnyxValue';
function HybridAppHandler() {
const {splashScreenState} = useSplashScreenState();
const {setSplashScreenState} = useSplashScreenActions();
const [tryNewDot, tryNewDotMetadata] = useOnyx(ONYXKEYS.NVP_TRY_NEW_DOT, {canBeMissing: true});
const [tryNewDot, tryNewDotMetadata] = useOnyx(ONYXKEYS.NVP_TRY_NEW_DOT);
const isLoadingTryNewDot = isLoadingOnyxValue(tryNewDotMetadata);

const finalizeTransitionFromOldDot = useCallback(
Expand Down
16 changes: 8 additions & 8 deletions src/components/AccountSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ function AccountSwitcher({isScreenFocused}: AccountSwitcherProps) {
const {localeCompare, translate, formatPhoneNumber} = useLocalize();
const {isOffline} = useNetwork();
const {shouldUseNarrowLayout} = useResponsiveLayout();
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
const [accountID] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: false, selector: accountIDSelector});
const [isDebugModeEnabled] = useOnyx(ONYXKEYS.IS_DEBUG_MODE_ENABLED, {canBeMissing: true});
const [credentials] = useOnyx(ONYXKEYS.CREDENTIALS, {canBeMissing: true});
const [stashedCredentials = CONST.EMPTY_OBJECT] = useOnyx(ONYXKEYS.STASHED_CREDENTIALS, {canBeMissing: true});
const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: true});
const [stashedSession] = useOnyx(ONYXKEYS.STASHED_SESSION, {canBeMissing: true});
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID, {canBeMissing: true});
const [account] = useOnyx(ONYXKEYS.ACCOUNT);
const [accountID] = useOnyx(ONYXKEYS.SESSION, {selector: accountIDSelector});
const [isDebugModeEnabled] = useOnyx(ONYXKEYS.IS_DEBUG_MODE_ENABLED);
const [credentials] = useOnyx(ONYXKEYS.CREDENTIALS);
const [stashedCredentials = CONST.EMPTY_OBJECT] = useOnyx(ONYXKEYS.STASHED_CREDENTIALS);
const [session] = useOnyx(ONYXKEYS.SESSION);
const [stashedSession] = useOnyx(ONYXKEYS.STASHED_SESSION);
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID);

const buttonRef = useRef<HTMLDivElement>(null);
const {windowHeight} = useWindowDimensions();
Expand Down
2 changes: 1 addition & 1 deletion src/components/AddPaymentCard/PaymentCardForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function PaymentCardForm({
currencySelectorRoute,
}: PaymentCardFormProps) {
const styles = useThemeStyles();
const [data, metadata] = useOnyx(ONYXKEYS.FORMS.ADD_PAYMENT_CARD_FORM, {canBeMissing: true});
const [data, metadata] = useOnyx(ONYXKEYS.FORMS.ADD_PAYMENT_CARD_FORM);

const {translate} = useLocalize();
const route = useRoute();
Expand Down
4 changes: 2 additions & 2 deletions src/components/AddPaymentMethodMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ function AddPaymentMethodMenu({
const icons = useMemoizedLazyExpensifyIcons(['Building', 'Bank']);
const {translate} = useLocalize();
const [restoreFocusType, setRestoreFocusType] = useState<BaseModalProps['restoreFocusType']>();
const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: true});
const [introSelected, introSelectedStatus] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {canBeMissing: true});
const [session] = useOnyx(ONYXKEYS.SESSION);
const [introSelected, introSelectedStatus] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);

// Users can choose to pay with business bank account in case of Expense reports or in case of P2P IOU report
// which then starts a bottom up flow and creates a Collect workspace where the payer is an admin and payee is an employee.
Expand Down
4 changes: 2 additions & 2 deletions src/components/AddPlaidBankAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ function AddPlaidBankAccount({
const subscribedKeyboardShortcuts = useRef<Array<() => void>>([]);
const previousNetworkState = useRef<boolean | undefined>(undefined);
const [selectedPlaidAccountMask, setSelectedPlaidAccountMask] = useState(defaultSelectedPlaidAccountMask);
const [plaidLinkToken] = useOnyx(ONYXKEYS.PLAID_LINK_TOKEN, {canBeMissing: true, initWithStoredValues: false});
const [isPlaidDisabled] = useOnyx(ONYXKEYS.IS_PLAID_DISABLED, {canBeMissing: true});
const [plaidLinkToken] = useOnyx(ONYXKEYS.PLAID_LINK_TOKEN, {initWithStoredValues: false});
const [isPlaidDisabled] = useOnyx(ONYXKEYS.IS_PLAID_DISABLED);
const {translate} = useLocalize();
const {isOffline} = useNetwork();

Expand Down
12 changes: 6 additions & 6 deletions src/components/AddUnreportedExpenseFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ function AddUnreportedExpenseFooter({selectedIds, report, reportToConfirm, repor
const isASAPSubmitBetaEnabled = isBetaEnabled(CONST.BETAS.ASAP_SUBMIT);
const session = useSession();
const personalDetails = usePersonalDetails();
const [allTransactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: true});
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {canBeMissing: true});
const [policyRecentlyUsedCurrencies] = useOnyx(ONYXKEYS.RECENTLY_USED_CURRENCIES, {canBeMissing: true});
const [quickAction] = useOnyx(ONYXKEYS.NVP_QUICK_ACTION_GLOBAL_CREATE, {canBeMissing: true});
const [betas] = useOnyx(ONYXKEYS.BETAS, {canBeMissing: true});
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report?.chatReportID}`, {canBeMissing: true});
const [allTransactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION);
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
const [policyRecentlyUsedCurrencies] = useOnyx(ONYXKEYS.RECENTLY_USED_CURRENCIES);
const [quickAction] = useOnyx(ONYXKEYS.NVP_QUICK_ACTION_GLOBAL_CREATE);
const [betas] = useOnyx(ONYXKEYS.BETAS);
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report?.chatReportID}`);

const handleConfirm = () => {
if (selectedIds.size === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
const sourceURLWithAuth = addEncryptedAuthTokenToURL(source);
const sourceID = (source.match(CONST.REGEX.ATTACHMENT_ID) ?? [])[1];

const [download] = useOnyx(`${ONYXKEYS.COLLECTION.DOWNLOAD}${sourceID}`, {canBeMissing: true});
const [download] = useOnyx(`${ONYXKEYS.COLLECTION.DOWNLOAD}${sourceID}`);
const {translate} = useLocalize();

const {isOffline} = useNetwork();
Expand All @@ -39,7 +39,7 @@
return (
<ShowContextMenuContext.Consumer>
{({anchor, report, isReportArchived, action, checkIfContextMenuActive, isDisabled, shouldDisplayContextMenu}) => (
<PressableWithoutFeedback

Check failure on line 42 in src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

All Pressable components must include sentryLabel prop for Sentry tracking. Example: <PressableWithoutFeedback sentryLabel="MoreMenu-ExportFile" />
style={[style, (isOffline || !sourceID) && styles.cursorDefault]}
onPress={() => {
if (isDownloading || isOffline || !sourceID) {
Expand Down
1 change: 0 additions & 1 deletion src/components/ApprovalWorkflowSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ function ApprovalWorkflowSection({approvalWorkflow, onPress, currency = CONST.CU
const {translate, toLocaleOrdinal, localeCompare} = useLocalize();
const {shouldUseNarrowLayout} = useResponsiveLayout();
const [personalDetailsByEmail] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {
canBeMissing: true,
selector: personalDetailsByEmailSelector,
});

Expand Down
2 changes: 1 addition & 1 deletion src/components/ApproverSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function ApproverSelectionList({
const styles = useThemeStyles();
const {translate, localeCompare} = useLocalize();
const [searchTerm, debouncedSearchTerm, setSearchTerm] = useDebouncedState('');
const [countryCode = CONST.DEFAULT_COUNTRY_CODE] = useOnyx(ONYXKEYS.COUNTRY_CODE, {canBeMissing: false});
const [countryCode = CONST.DEFAULT_COUNTRY_CODE] = useOnyx(ONYXKEYS.COUNTRY_CODE);
const shouldShowTextInput = shouldShowTextInputProp ?? allApprovers?.length >= CONST.STANDARD_LIST_ITEM_LIMIT;
const lazyIllustrations = useMemoizedLazyIllustrations(['TurtleInShell']);

Expand Down
4 changes: 2 additions & 2 deletions src/components/ArchivedReportFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function ArchivedReportFooter({report, currentUserAccountID}: ArchivedReportFoot
const styles = useThemeStyles();
const {translate} = useLocalize();

const [personalDetails = getEmptyObject<PersonalDetailsList>()] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {canBeMissing: false});
const [reportClosedAction] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}`, {canEvict: false, selector: getLastClosedReportAction, canBeMissing: true});
const [personalDetails = getEmptyObject<PersonalDetailsList>()] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST);
const [reportClosedAction] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}`, {canEvict: false, selector: getLastClosedReportAction});
const originalMessage = isClosedAction(reportClosedAction) ? getOriginalMessage(reportClosedAction) : null;
const archiveReason = originalMessage?.reason ?? CONST.REPORT.ARCHIVE_REASON.DEFAULT;
const actorPersonalDetails = personalDetails?.[reportClosedAction?.actorAccountID ?? CONST.DEFAULT_NUMBER_ID];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function CarouselItem({item, onPress, isFocused, isModalHovered, reportID}: Caro
const {translate} = useLocalize();
const {isAttachmentHidden} = useContext(AttachmentModalContext);
const [isHidden, setIsHidden] = useState(() => (item.reportActionID && isAttachmentHidden(item.reportActionID)) ?? item.hasBeenFlagged);
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {canBeMissing: true});
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`);

const renderButton = (style: StyleProp<ViewStyle>) => (
<Button
Expand Down
4 changes: 2 additions & 2 deletions src/components/Attachments/AttachmentCarousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function AttachmentCarousel({
attachmentLink,
onAttachmentError,
}: AttachmentCarouselProps) {
const [parentReportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID}`, {canEvict: false, canBeMissing: true});
const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}`, {canEvict: false, canBeMissing: true});
const [parentReportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID}`, {canEvict: false});
const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}`, {canEvict: false});
const canUseTouchScreen = canUseTouchScreenUtil();
const styles = useThemeStyles();
const isReportArchived = useReportIsArchived(report.reportID);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Attachments/AttachmentView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function AttachmentView({
transaction: transactionProp,
}: AttachmentViewProps) {
const icons = useMemoizedLazyExpensifyIcons(['ArrowCircleClockwise', 'Gallery']);
const [transactionFromOnyx] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${getNonEmptyStringOnyxID(transactionID)}`, {canBeMissing: true});
const [transactionFromOnyx] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${getNonEmptyStringOnyxID(transactionID)}`);
const transaction = transactionProp ?? transactionFromOnyx;
const {translate} = useLocalize();
const {currentlyPlayingURL} = usePlaybackStateContext();
Expand Down
Loading
Loading