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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libs/DomainUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ function getMemberCustomRowProps(accountID: number, domainPendingActions: Domain
};
}

export {hasDomainErrors, hasDomainAdminsSettingsErrors, hasDomainAdminsErrors, hasDomainMembersErrors, hasDomainMemberDetailsErrors, hasDomainMembersSettingsErrors, getMemberCustomRowProps};
export {hasDomainErrors, hasDomainAdminsSettingsErrors, hasDomainAdminsErrors, hasDomainMembersErrors, hasDomainMembersSettingsErrors, getMemberCustomRowProps};
2 changes: 0 additions & 2 deletions src/libs/EmojiUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,6 @@ function getTextVSCursorOffset(text: string, cursorPosition: number | undefined
export type {HeaderIndices, EmojiPickerList, EmojiPickerListItem};

export {
findEmojiByName,
findEmojiByCode,
getLocalizedEmojiName,
getProcessedText,
Expand All @@ -819,7 +818,6 @@ export {
suggestEmojis,
getEmojiCodeWithSkinColor,
getPreferredEmojiCode,
getUniqueEmojiCodes,
getEmojiReactionDetails,
replaceAndExtractEmojis,
extractEmojis,
Expand Down
9 changes: 1 addition & 8 deletions src/libs/Environment/Environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ function isDevelopment(): boolean {
return (Config?.ENVIRONMENT ?? CONST.ENVIRONMENT.DEV) === CONST.ENVIRONMENT.DEV;
}

/**
* Are we running the app in staging?
*/
function isStaging(): boolean {
return (Config?.ENVIRONMENT ?? CONST.ENVIRONMENT.DEV) === CONST.ENVIRONMENT.STAGING;
}

/**
* Are we running the app in production?
*/
Expand Down Expand Up @@ -69,4 +62,4 @@ function getOldDotEnvironmentURL(): Promise<string> {
return getEnvironment().then((environment) => OLDDOT_ENVIRONMENT_URLS[environment]);
}

export {getEnvironment, isInternalTestBuild, isDevelopment, isStaging, isProduction, getEnvironmentURL, getOldDotEnvironmentURL, getOldDotURLFromEnvironment};
export {isInternalTestBuild, isDevelopment, isProduction, getEnvironmentURL, getOldDotEnvironmentURL, getOldDotURLFromEnvironment};
1 change: 0 additions & 1 deletion src/libs/ErrorUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ export {
getAuthenticateErrorMessage,
getEarliestErrorField,
getErrorMessage,
getErrorMessageWithTranslationData,
getErrorsWithTranslationData,
getLatestErrorField,
getLatestErrorFieldForAnyField,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Formula.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import CONST from '@src/CONST';
import type {PersonalDetails, Policy, PolicyReportField, Report, Transaction} from '@src/types/onyx';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import {convertToDisplayString, convertToDisplayStringWithoutCurrency} from './CurrencyUtils';
import {formatDate} from './FormulaDatetime';
import formatDate from './FormulaDatetime';
import getBase62ReportID from './getBase62ReportID';
import Log from './Log';
import {getAllReportActions} from './ReportActionsUtils';
Expand Down
2 changes: 1 addition & 1 deletion src/libs/FormulaDatetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@ function formatDate(dateString: string | undefined, format = 'yyyy-MM-dd'): stri
}
}

export {formatDate, getOrdinalSuffix, calculateISOWeekNumber, calculateDayOfYear, getLocalizedNames, getUTCTimeComponents, createDateTokens, applyTokenReplacement};
export default formatDate;
2 changes: 1 addition & 1 deletion src/libs/GPSDraftDetailsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ function isTripCaptured(gpsDraftDetails: GpsDraftDetails | undefined): boolean {
return !gpsDraftDetails?.isTracking && (gpsDraftDetails?.gpsPoints?.length ?? 0) > 0;
}

export {getGPSRoutes, getGPSWaypoints, stopGpsTrip, getGPSConvertedDistance, getGPSCoordinates, addressFromGpsPoint, coordinatesToString, calculateGPSDistance, isTripCaptured};
export {getGPSRoutes, getGPSWaypoints, stopGpsTrip, getGPSConvertedDistance, getGPSCoordinates, addressFromGpsPoint, coordinatesToString, isTripCaptured};
1 change: 0 additions & 1 deletion src/libs/MergeTransactionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,6 @@ export {
DERIVED_MERGE_FIELDS,
getRateFromMerchant,
getTransactionsAndReportsFromSearch,
MERGE_FIELDS,
};

export type {MergeFieldKey, MergeFieldData, MergeTransactionUpdateValues};
2 changes: 1 addition & 1 deletion src/libs/Middleware/Reauthentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,4 @@ const Reauthentication: Middleware = (response, request, isFromSequentialQueue)
});

export default Reauthentication;
export {reauthenticate, resetReauthentication, reauthThrottle};
export {resetReauthentication};
1 change: 0 additions & 1 deletion src/libs/MoneyRequestReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ export {
getReportIDForTransaction,
getTotalAmountForIOUReportPreviewButton,
getAllNonDeletedTransactions,
isSingleTransactionReport,
shouldDisplayReportTableView,
shouldWaitForTransactions,
isBillableEnabledOnPolicy,
Expand Down
1 change: 0 additions & 1 deletion src/libs/MultifactorAuthentication/Passkeys/WebAuthn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ function decodeWebAuthnError(error: unknown): DecodedWebAuthnError {
export {
PASSKEY_AUTH_TYPE,
arrayBufferToBase64URL,
base64URLToArrayBuffer,
isWebAuthnSupported,
buildPublicKeyCredentialCreationOptions,
buildPublicKeyCredentialRequestOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,4 @@ function SettingsSplitNavigator() {
);
}

export {CENTRAL_PANE_SETTINGS_SCREENS};
export default SettingsSplitNavigator;
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,4 @@ function WorkspaceSplitNavigator({route}: PlatformStackScreenProps<WorkspaceNavi
);
}

export {CENTRAL_PANE_WORKSPACE_SCREENS};
export default WorkspaceSplitNavigator;
17 changes: 2 additions & 15 deletions src/libs/Navigation/Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import ONYXKEYS from '@src/ONYXKEYS';
import type {Route} from '@src/ROUTES';
import ROUTES from '@src/ROUTES';
import SCREENS, {PROTECTED_SCREENS} from '@src/SCREENS';
import type {Account, SidePanel} from '@src/types/onyx';
import type {SidePanel} from '@src/types/onyx';
import getInitialSplitNavigatorState from './AppNavigator/createSplitNavigator/getInitialSplitNavigatorState';
import originalCloseRHPFlow from './helpers/closeRHPFlow';
import findMatchingDynamicSuffix from './helpers/dynamicRoutesUtils/findMatchingDynamicSuffix';
Expand Down Expand Up @@ -71,15 +71,6 @@ const SET_UP_2FA_SCREENS = new Set<string>([

const MFA_FLOW_SCREENS = new Set<string>(Object.values(SCREENS.MULTIFACTOR_AUTHENTICATION));

let account: OnyxEntry<Account>;
// We have used `connectWithoutView` here because it is not connected to any UI
Onyx.connectWithoutView({
key: ONYXKEYS.ACCOUNT,
callback: (value) => {
account = value;
},
});

let sidePanelNVP: OnyxEntry<SidePanel>;
// `connectWithoutView` is used here because we want to avoid unnecessary re-renders when the side panel NVP changes
// Also it is not directly connected to any UI
Expand All @@ -98,10 +89,6 @@ function isMFAFlowScreen(screen: string | undefined): boolean {
return screen ? MFA_FLOW_SCREENS.has(screen) : false;
}

function shouldShowRequire2FAPage() {
return !!account?.needsTwoFactorAuthSetup && !account?.requiresTwoFactorAuth;
}

let resolveNavigationIsReadyPromise: () => void;
const navigationIsReadyPromise = new Promise<void>((resolve) => {
resolveNavigationIsReadyPromise = resolve;
Expand Down Expand Up @@ -1180,4 +1167,4 @@ export default {
navigateBackToLastSuperWideRHPScreen,
};

export {navigationRef, getDeepestFocusedScreen, isTwoFactorSetupScreen, isMFAFlowScreen, shouldShowRequire2FAPage};
export {navigationRef, getDeepestFocusedScreen, isTwoFactorSetupScreen, isMFAFlowScreen};
16 changes: 2 additions & 14 deletions src/libs/Navigation/helpers/isNavigatorName.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {SIDEBAR_TO_SPLIT, SPLIT_TO_SIDEBAR} from '@libs/Navigation/linkingConfig/RELATIONS';
import type {FullScreenName, OnboardingFlowName, PublicScreenName, SplitNavigatorName, SplitNavigatorSidebarScreen, WorkspaceNavigatorRouteName} from '@libs/Navigation/types';
import type {FullScreenName, OnboardingFlowName, SplitNavigatorName, SplitNavigatorSidebarScreen, WorkspaceNavigatorRouteName} from '@libs/Navigation/types';
import NAVIGATORS from '@src/NAVIGATORS';
import SCREENS from '@src/SCREENS';

Expand All @@ -8,14 +8,6 @@ const SIDEBARS_SET = new Set(Object.values(SPLIT_TO_SIDEBAR));
const ONBOARDING_SCREENS_SET = new Set(Object.values(SCREENS.ONBOARDING));
const SPLIT_NAVIGATORS_SET = new Set(Object.values(SIDEBAR_TO_SPLIT));
const WORKSPACES_TAB_SET = new Set(Object.values([NAVIGATORS.WORKSPACE_SPLIT_NAVIGATOR, SCREENS.WORKSPACES_LIST, NAVIGATORS.DOMAIN_SPLIT_NAVIGATOR]));
const PUBLIC_SCREENS_SET = new Set<PublicScreenName>([
SCREENS.TRANSITION_BETWEEN_APPS,
SCREENS.VALIDATE_LOGIN,
SCREENS.CONNECTION_COMPLETE,
SCREENS.BANK_CONNECTION_COMPLETE,
SCREENS.UNLINK_LOGIN,
SCREENS.SAML_SIGN_IN,
]);

/**
* Functions defined below are used to check whether a screen belongs to a specific group.
Expand Down Expand Up @@ -49,8 +41,4 @@ function isWorkspaceNavigatorRouteName(screen: string | undefined) {
return checkIfScreenHasMatchingNameToSetValues<WorkspaceNavigatorRouteName>(screen, WORKSPACES_TAB_SET);
}

function isPublicScreenName(screen: string | undefined) {
return checkIfScreenHasMatchingNameToSetValues<PublicScreenName>(screen, PUBLIC_SCREENS_SET);
}

export {isFullScreenName, isOnboardingFlowName, isPublicScreenName, isSidebarScreenName, isSplitNavigatorName, isWorkspaceNavigatorRouteName};
export {isFullScreenName, isOnboardingFlowName, isSidebarScreenName, isSplitNavigatorName, isWorkspaceNavigatorRouteName};
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import type {NavigationState, PartialState} from '@react-navigation/native';
import type {Route} from '@src/ROUTES';

function clearSessionStorage() {}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand All @@ -9,11 +6,6 @@ function saveWorkspacesTabPathToSessionStorage(url: string) {}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function saveSettingsTabPathToSessionStorage(url: string) {}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function getLastVisitedTabPath(state: NavigationState | PartialState<NavigationState>): Route | undefined {
return undefined;
}

function getWorkspacesTabStateFromSessionStorage() {
return undefined;
}
Expand All @@ -28,7 +20,6 @@ function getLastVisitedWorkspaceTabScreen() {
export {
clearSessionStorage,
getLastVisitedWorkspaceTabScreen,
getLastVisitedTabPath,
saveSettingsTabPathToSessionStorage,
getSettingsTabStateFromSessionStorage,
saveWorkspacesTabPathToSessionStorage,
Expand Down
14 changes: 1 addition & 13 deletions src/libs/Navigation/helpers/lastVisitedTabPathUtils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {InitialState, NavigationState, PartialState} from '@react-navigation/native';
import type {InitialState} from '@react-navigation/native';
import {findFocusedRoute} from '@react-navigation/native';
import type {ValueOf} from 'type-fest';
import getStateFromPath from '@libs/Navigation/helpers/getStateFromPath';
Expand Down Expand Up @@ -32,17 +32,6 @@ function getTabStateFromSessionStorage(key: LastVisitedTabPathKey) {
return getStateFromPath(path);
}

/**
* Generic function to extract the path from currently focused route
*/
function getLastVisitedTabPath(state: NavigationState | PartialState<NavigationState>) {
const focusedRoute = findFocusedRoute(state);
if (!focusedRoute) {
return undefined;
}
return focusedRoute.path as Route;
}

function saveWorkspacesTabPathToSessionStorage(url: string) {
saveTabPathToSessionStorage(CONST.SESSION_STORAGE_KEYS.LAST_VISITED_PATH.WORKSPACES_TAB, url);
}
Expand Down Expand Up @@ -70,7 +59,6 @@ function getLastVisitedWorkspaceTabScreen() {
export {
clearSessionStorage,
getLastVisitedWorkspaceTabScreen,
getLastVisitedTabPath,
saveSettingsTabPathToSessionStorage,
getSettingsTabStateFromSessionStorage,
saveWorkspacesTabPathToSessionStorage,
Expand Down
5 changes: 0 additions & 5 deletions src/libs/Navigation/linkingConfig/RELATIONS/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,15 @@ const RHP_TO_DOMAIN = createInverseRelation(DOMAIN_TO_RHP);
const RHP_TO_HOME = createInverseRelation(HOME_TO_RHP);

export {
SETTINGS_TO_RHP,
RHP_TO_SETTINGS,
RHP_TO_WORKSPACE,
RHP_TO_SIDEBAR,
RHP_TO_SEARCH,
SEARCH_TO_RHP,
SIDEBAR_TO_RHP,
WORKSPACE_TO_RHP,
SIDEBAR_TO_SPLIT,
SPLIT_TO_SIDEBAR,
TAB_TO_FULLSCREEN,
FULLSCREEN_TO_TAB,
RHP_TO_WORKSPACES_LIST,
RHP_TO_DOMAIN,
HOME_TO_RHP,
RHP_TO_HOME,
};
6 changes: 0 additions & 6 deletions src/libs/Network/SequentialQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,6 @@ function isPaused(): boolean {
return isQueuePaused;
}

function getShouldFailAllRequests(): boolean {
return shouldFailAllRequests;
}

// Flush the queue when the persisted requests are initialized
onPersistedRequestsInitialization(flush);

Expand Down Expand Up @@ -595,11 +591,9 @@ function resetQueue(): void {
export {
flush,
getCurrentRequest,
getShouldFailAllRequests,
isPaused,
isRunning,
pause,
process,
push,
resetQueue,
sequentialQueueRequestThrottle,
Expand Down
1 change: 0 additions & 1 deletion src/libs/NextStepUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,6 @@ export {
buildNextStepMessage,
buildOptimisticNextStep,
parseMessage,
buildOptimisticNextStepForPreventSelfApprovalsEnabled,
buildOptimisticNextStepForStrictPolicyRuleViolations,
buildOptimisticNextStepForDynamicExternalWorkflowSubmitError,
buildOptimisticNextStepForDynamicExternalWorkflowApproveError,
Expand Down
7 changes: 0 additions & 7 deletions src/libs/OptionsListUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
*/

let allReports: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 219 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -232,7 +232,7 @@
const deprecatedCachedOneTransactionThreadReportIDs: Record<string, string | undefined> = {};
/** @deprecated Use sortedReportActionsData from ONYXKEYS.DERIVED.RAM_ONLY_SORTED_REPORT_ACTIONS instead. Will be removed once all flows are migrated. */
let deprecatedAllReportActions: OnyxCollection<ReportActions>;
Onyx.connect({

Check warning on line 235 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
Expand Down Expand Up @@ -282,7 +282,7 @@
});

let activePolicyID: OnyxEntry<string>;
Onyx.connect({

Check warning on line 285 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NVP_ACTIVE_POLICY_ID,
callback: (value) => (activePolicyID = value),
});
Expand Down Expand Up @@ -3421,13 +3421,10 @@
createFilteredOptionList,
createOption,
filterAndOrderOptions,
filterOptions,
filterReports,
filterSelectedOptions,
filterSelfDMChat,
filterUserToInvite,
filterWorkspaceChats,
filteredPersonalDetailsOfRecentReports,
formatMemberForList,
formatSectionsFromSearchTerm,
getAlternateText,
Expand Down Expand Up @@ -3458,13 +3455,9 @@
isDisablingOrDeletingLastEnabledTag,
isMakingLastRequiredTagListOptional,
isPersonalDetailsReady,
isSearchStringMatch,
isSearchStringMatchUserDetails,
optionsOrderBy,
orderOptions,
orderPersonalDetailsOptions,
orderReportOptions,
orderReportOptionsWithSearch,
orderWorkspaceOptions,
processReport,
recentReportComparator,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/PersonalDetailOptionsListUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,6 @@ function getHeaderMessage(translate: LocaleContextProps['translate'], searchValu
return translate('common.noResultsFound');
}

export {createOption, getUserToInviteOption, canCreateOptimisticPersonalDetailOption, filterOption, matchesSearchTerms, getValidOptions, createOptionList, getHeaderMessage};
export {createOption, canCreateOptimisticPersonalDetailOption, filterOption, matchesSearchTerms, getValidOptions, createOptionList, getHeaderMessage};

export type {OptionData, Options};
Loading