Skip to content

Commit 63204ef

Browse files
authored
Merge pull request Expensify#88284 from shubham1206agra/knip-audit-export-5
[NoQA] Remove unused exports (batch 5)
2 parents 7339429 + e3c8528 commit 63204ef

21 files changed

Lines changed: 21 additions & 178 deletions

src/libs/ReportUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ import type {IOURequestType} from './actions/IOU';
9191
import {unholdRequest} from './actions/IOU/Hold';
9292
import {canApproveIOU, canIOUBePaid, canSubmitReport, getBadgeFromIOUReport, getIOUReportActionWithBadge} from './actions/IOU/ReportWorkflow';
9393
import {createDraftWorkspace} from './actions/Policy/Policy';
94-
import {hasCreditBankAccount} from './actions/ReimbursementAccount/store';
94+
import hasCreditBankAccount from './actions/ReimbursementAccount/hasCreditBankAccount';
9595
import {openUnreportedExpense} from './actions/Report';
9696
import type {GuidedSetupData, TaskForParameters} from './actions/Report';
9797
import {isAnonymousUser as isAnonymousUserSession} from './actions/Session';

src/libs/actions/BankAccounts.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ import {setBankAccountSubStep} from './ReimbursementAccount';
4747

4848
export {
4949
goToWithdrawalAccountSetupStep,
50-
setBankAccountFormValidationErrors,
51-
resetReimbursementAccount,
5250
resetUSDBankAccount,
5351
resetNonUSDBankAccount,
5452
hideBankAccountErrors,

src/libs/actions/CompanyCards.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,6 @@ function setAssignCardStepAndData({cardToAssign, isEditing, currentStep, isRefre
154154
Onyx.merge(ONYXKEYS.ASSIGN_CARD, {cardToAssign, isEditing, currentStep, isRefreshing});
155155
}
156156

157-
function setTransactionStartDate(startDate: string) {
158-
Onyx.merge(ONYXKEYS.ASSIGN_CARD, {startDate});
159-
}
160-
161157
function clearAssignCardStepAndData() {
162158
Onyx.set(ONYXKEYS.ASSIGN_CARD, {});
163159
}
@@ -1025,35 +1021,6 @@ function openPolicyCompanyCardsFeed(domainAccountID: number, policyID: string, f
10251021
API.read(READ_COMMANDS.OPEN_POLICY_COMPANY_CARDS_FEED, parameters, {optimisticData, successData, failureData});
10261022
}
10271023

1028-
function openAssignFeedCardPage(policyID: string, feed: CompanyCardFeedWithNumber, domainOrWorkspaceAccountID: number) {
1029-
const parameters: OpenPolicyCompanyCardsFeedParams = {
1030-
policyID,
1031-
feed,
1032-
};
1033-
1034-
const optimisticData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER>> = [
1035-
{
1036-
onyxMethod: Onyx.METHOD.MERGE,
1037-
key: `${ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER}${domainOrWorkspaceAccountID}`,
1038-
value: {
1039-
isLoading: true,
1040-
},
1041-
},
1042-
];
1043-
1044-
const finallyData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER>> = [
1045-
{
1046-
onyxMethod: Onyx.METHOD.MERGE,
1047-
key: `${ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER}${domainOrWorkspaceAccountID}`,
1048-
value: {
1049-
isLoading: false,
1050-
},
1051-
},
1052-
];
1053-
1054-
API.read(READ_COMMANDS.OPEN_ASSIGN_FEED_CARD_PAGE, parameters, {optimisticData, finallyData});
1055-
}
1056-
10571024
function openPolicyAddCardFeedPage(policyID: string | undefined) {
10581025
if (!policyID) {
10591026
return;
@@ -1425,9 +1392,7 @@ export {
14251392
clearAddNewCardFlow,
14261393
setAssignCardStepAndData,
14271394
clearAssignCardStepAndData,
1428-
openAssignFeedCardPage,
14291395
openPolicyAddCardFeedPage,
1430-
setTransactionStartDate,
14311396
setFeedStatementPeriodEndDay,
14321397
importCSVCompanyCards,
14331398
clearErrorField,

src/libs/actions/Delegate.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ type IsConnectedAsDelegateParams = WithDelegatedAccess;
110110
// Connect as delegate
111111
type ConnectParams = WithEmail & WithDelegatedAccess & WithOldDotFlag & WithCredentials & WithSession & WithActivePolicyID;
112112

113-
// Clear pending action for role update
114-
type ClearDelegateRolePendingActionParams = WithEmail & WithDelegatedAccess;
115-
116113
/**
117114
* Connects the user as a delegate to another account.
118115
* Returns a Promise that resolves to true on success, false on failure, or undefined if not applicable.
@@ -332,10 +329,6 @@ function clearDelegatorErrors({delegatedAccess}: ClearDelegatorErrorsParams) {
332329
Onyx.merge(ONYXKEYS.ACCOUNT, {delegatedAccess: {delegators: delegatedAccess.delegators.map((delegator) => ({...delegator, errorFields: undefined}))}});
333330
}
334331

335-
function requestValidationCode() {
336-
API.write(WRITE_COMMANDS.RESEND_VALIDATE_CODE, null);
337-
}
338-
339332
function addDelegate({email, role, validateCode, delegatedAccess}: AddDelegateParams) {
340333
if (!delegatedAccess?.delegates) {
341334
return;
@@ -669,34 +662,6 @@ function updateDelegateRole({email, role, validateCode, delegatedAccess}: Update
669662
API.write(WRITE_COMMANDS.UPDATE_DELEGATE_ROLE, parameters, {optimisticData, successData, failureData});
670663
}
671664

672-
function clearDelegateRolePendingAction({email, delegatedAccess}: ClearDelegateRolePendingActionParams) {
673-
if (!delegatedAccess?.delegates) {
674-
return;
675-
}
676-
677-
const optimisticData: Array<OnyxUpdate<typeof ONYXKEYS.ACCOUNT>> = [
678-
{
679-
onyxMethod: Onyx.METHOD.MERGE,
680-
key: ONYXKEYS.ACCOUNT,
681-
value: {
682-
delegatedAccess: {
683-
delegates: delegatedAccess.delegates.map((delegate) =>
684-
delegate.email === email
685-
? {
686-
...delegate,
687-
pendingAction: null,
688-
pendingFields: undefined,
689-
}
690-
: delegate,
691-
),
692-
},
693-
},
694-
},
695-
];
696-
697-
Onyx.update(optimisticData);
698-
}
699-
700665
function restoreDelegateSession<TKey extends OnyxKey>(authenticateResponse: Response<TKey>) {
701666
Onyx.clear(KEYS_TO_PRESERVE_DELEGATE_ACCESS).then(() => {
702667
updateSessionAuthTokens(authenticateResponse?.authToken, authenticateResponse?.encryptedAuthToken);
@@ -719,11 +684,9 @@ export {
719684
disconnect,
720685
clearDelegatorErrors,
721686
addDelegate,
722-
requestValidationCode,
723687
clearDelegateErrorsByField,
724688
restoreDelegateSession,
725689
isConnectedAsDelegate,
726-
clearDelegateRolePendingAction,
727690
updateDelegateRole,
728691
removeDelegate,
729692
openSecuritySettingsPage,

src/libs/actions/HybridApp/index.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,6 @@ function setUseNewDotSignInPage(useNewDotSignInPage: boolean) {
131131
return Onyx.merge(ONYXKEYS.HYBRID_APP, {useNewDotSignInPage});
132132
}
133133

134-
function setClosingReactNativeApp(closingReactNativeApp: boolean) {
135-
// This value is only relevant for HybridApp, so we can skip it in other environments.
136-
if (!CONFIG.IS_HYBRID_APP) {
137-
return;
138-
}
139-
Onyx.merge(ONYXKEYS.HYBRID_APP, {closingReactNativeApp});
140-
}
141-
142134
/*
143135
* Starts HybridApp sign-in flow from the beginning.
144136
*/
@@ -154,4 +146,4 @@ function resetSignInFlow() {
154146
});
155147
}
156148

157-
export {getHybridAppSettings, setReadyToShowAuthScreens, resetSignInFlow, setUseNewDotSignInPage, setClosingReactNativeApp, closeReactNativeApp};
149+
export {getHybridAppSettings, setReadyToShowAuthScreens, resetSignInFlow, setUseNewDotSignInPage, closeReactNativeApp};

src/libs/actions/IOU/BulkEdit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,5 +580,5 @@ function updateBulkEditDraftTransaction(transactionChanges: NullishDeep<OnyxType
580580
Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${CONST.IOU.OPTIMISTIC_BULK_EDIT_TRANSACTION_ID}`, transactionChanges);
581581
}
582582

583-
export {removeUnchangedBulkEditFields, updateMultipleMoneyRequests, initBulkEditDraftTransaction, clearBulkEditDraftTransaction, updateBulkEditDraftTransaction};
583+
export {updateMultipleMoneyRequests, initBulkEditDraftTransaction, clearBulkEditDraftTransaction, updateBulkEditDraftTransaction};
584584
export type {UpdateMultipleMoneyRequestsParams};

src/libs/actions/IOU/PayMoneyRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,5 +886,5 @@ function savePreferredPaymentMethod(
886886
});
887887
}
888888

889-
export {cancelPayment, completePaymentOnboarding, getPayMoneyRequestParams, payInvoice, payMoneyRequest, savePreferredPaymentMethod};
889+
export {cancelPayment, completePaymentOnboarding, payInvoice, payMoneyRequest, savePreferredPaymentMethod};
890890
export type {PayInvoiceArgs, PayMoneyRequestData, PayMoneyRequestFunctionParams};

src/libs/actions/IOU/TrackExpense.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2751,16 +2751,11 @@ function deleteTrackExpense({
27512751
}
27522752

27532753
export {
2754-
addTrackedExpenseToPolicy,
2755-
buildOnyxDataForTrackExpense,
2756-
categorizeTrackedExpense,
27572754
convertBulkTrackedExpensesToIOU,
2758-
convertTrackedExpenseToRequest,
27592755
deleteTrackExpense,
27602756
getDeleteTrackExpenseInformation,
27612757
getNavigationUrlAfterTrackExpenseDelete,
27622758
getTrackExpenseInformation,
2763-
shareTrackedExpense,
27642759
trackExpense,
27652760
requestMoney,
27662761
};

src/libs/actions/IOU/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import {
5151
getParsedComment,
5252
getReportNotificationPreference,
5353
getReportOrDraftReport,
54-
hasOutstandingChildRequest,
5554
hasViolations as hasViolationsReportUtils,
5655
isDeprecatedGroupDM,
5756
isExpenseReport,
@@ -573,10 +572,6 @@ function getUserAccountID(): number {
573572
return deprecatedUserAccountID;
574573
}
575574

576-
function getCurrentUserPersonalDetails(): OnyxEntry<OnyxTypes.PersonalDetails> {
577-
return deprecatedCurrentUserPersonalDetails;
578-
}
579-
580575
function getRecentAttendees(): OnyxEntry<Attendee[]> {
581576
return recentAttendees;
582577
}
@@ -3780,7 +3775,6 @@ export {
37803775
calculateDiffAmount,
37813776
getUpdatedMoneyRequestReportData,
37823777
startDistanceRequest,
3783-
hasOutstandingChildRequest,
37843778
getReportPreviewAction,
37853779
mergePolicyRecentlyUsedCurrencies,
37863780
mergePolicyRecentlyUsedCategories,
@@ -3792,14 +3786,12 @@ export {
37923786
getAllReportNameValuePairs,
37933787
getAllTransactionDrafts,
37943788
getCurrentUserEmail,
3795-
getCurrentUserPersonalDetails,
37963789
getUserAccountID,
37973790
getRecentAttendees,
37983791
getReceiptError,
37993792
// TODO: Replace getPolicyTagsData (https://github.com/Expensify/App/issues/72721) and getPolicyRecentlyUsedTagsData (https://github.com/Expensify/App/issues/71491) with useOnyx hook
38003793
// eslint-disable-next-line @typescript-eslint/no-deprecated
38013794
getPolicyTagsData,
3802-
maybeUpdateReportNameForFormulaTitle,
38033795
getSearchOnyxUpdate,
38043796
getPolicyTags,
38053797
// eslint-disable-next-line @typescript-eslint/no-deprecated

src/libs/actions/OnyxUpdateManager/utils/DeferredOnyxUpdates.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import CONST from '@src/CONST';
77
import ONYXKEYS from '@src/ONYXKEYS';
88
import type {OnyxUpdatesFromServer, Response} from '@src/types/onyx';
99
import {isValidOnyxUpdateFromServer} from '@src/types/onyx/OnyxUpdatesFromServer';
10-
// eslint-disable-next-line import/no-cycle
11-
import {validateAndApplyDeferredUpdates} from '.';
1210

1311
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1412
let missingOnyxUpdatesQueryPromise: Promise<Response<any> | Array<Response<any>> | void> | undefined;
@@ -59,17 +57,6 @@ function isEmpty() {
5957
return Object.keys(deferredUpdates).length === 0;
6058
}
6159

62-
/**
63-
* Manually processes and applies the updates from the deferred updates queue. (used e.g. for push notifications)
64-
*/
65-
function process() {
66-
if (missingOnyxUpdatesQueryPromise) {
67-
missingOnyxUpdatesQueryPromise.finally(() => validateAndApplyDeferredUpdates);
68-
}
69-
70-
missingOnyxUpdatesQueryPromise = validateAndApplyDeferredUpdates();
71-
}
72-
7360
type EnqueueDeferredOnyxUpdatesOptions = {
7461
shouldPauseSequentialQueue?: boolean;
7562
};
@@ -129,4 +116,4 @@ function clear(options?: ClearDeferredOnyxUpdatesOptions) {
129116
}
130117
}
131118

132-
export {getMissingOnyxUpdatesQueryPromise, setMissingOnyxUpdatesQueryPromise, getUpdates, isEmpty, process, enqueue, clear};
119+
export {getMissingOnyxUpdatesQueryPromise, setMissingOnyxUpdatesQueryPromise, getUpdates, isEmpty, enqueue, clear};

0 commit comments

Comments
 (0)