Skip to content

Commit 8189df6

Browse files
committed
chore: deleted unused get functions
1 parent cb05f61 commit 8189df6

File tree

2 files changed

+0
-49
lines changed

2 files changed

+0
-49
lines changed

src/hooks/custom-hooks/__tests__/useExtendedOrderDetails.spec.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -535,20 +535,6 @@ describe('useExtendedOrderDetails', () => {
535535
});
536536
});
537537

538-
describe('remainingSeconds', () => {
539-
it('should return remaining seconds', () => {
540-
mockData.orderDetails.expiry_time = 1627584000;
541-
mockData.serverTime = {
542-
server_time_moment: moment.unix(1627583999),
543-
server_time_utc: 1627583999,
544-
};
545-
546-
const { result } = renderHook(() => useExtendedOrderDetails(mockData));
547-
548-
expect(result.current.data.remainingSeconds).toBe(1);
549-
});
550-
});
551-
552538
describe('shouldHighlightAlert', () => {
553539
it('should return false if timer has expired', () => {
554540
mockData.orderDetails.expiry_time = 1627584000;
@@ -847,26 +833,6 @@ describe('useExtendedOrderDetails', () => {
847833
});
848834
});
849835

850-
describe('shouldShowOrderFooter', () => {
851-
it('should return false if shouldShowCancelAndPaidButton, shouldShowComplainAndReceivedButton, shouldShowOnlyComplainButton, shouldShowOnlyReceivedButton are false', () => {
852-
mockData.orderDetails.status = 'completed';
853-
854-
const { result } = renderHook(() => useExtendedOrderDetails(mockData));
855-
856-
expect(result.current.data.shouldShowOrderFooter).toBe(false);
857-
});
858-
859-
it('should return true if `shouldShowCancelAndPaidButton is true', () => {
860-
mockData.orderDetails.status = 'pending';
861-
mockData.orderDetails.advertiser_details.loginid = '123';
862-
mockData.orderDetails.type = 'sell';
863-
864-
const { result } = renderHook(() => useExtendedOrderDetails(mockData));
865-
866-
expect(result.current.data.shouldShowOrderFooter).toBe(true);
867-
});
868-
});
869-
870836
describe('shouldShowOrderTimer', () => {
871837
it('should return false if order is completed', () => {
872838
mockData.orderDetails.status = 'completed';

src/hooks/custom-hooks/useExtendedOrderDetails.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export interface ExtendedOrderDetails extends TOrder {
4747
otherUserDetails: TUserDetails;
4848
purchaseTime: string;
4949
rateAmount: string;
50-
remainingSeconds: number;
5150
shouldHighlightAlert: boolean;
5251
shouldHighlightDanger: boolean;
5352
shouldHighlightDisabled: boolean;
@@ -57,7 +56,6 @@ export interface ExtendedOrderDetails extends TOrder {
5756
shouldShowLostFundsBanner: boolean;
5857
shouldShowOnlyComplainButton: boolean;
5958
shouldShowOnlyReceivedButton: boolean;
60-
shouldShowOrderFooter: boolean;
6159
shouldShowOrderTimer: boolean;
6260
statusForBuyerConfirmedOrder: string;
6361
statusForPendingOrder: string;
@@ -243,11 +241,6 @@ const useExtendedOrderDetails = ({
243241
})
244242
);
245243
},
246-
get remainingSeconds() {
247-
const serverTimeAmount = serverTime?.server_time_moment;
248-
const expiryTimeMoment = toMoment(this.expiry_time);
249-
return expiryTimeMoment.diff(serverTimeAmount, 'seconds');
250-
},
251244
get shouldHighlightAlert() {
252245
if (this.hasTimerExpired) return false;
253246
if (this.isMyAd) {
@@ -299,14 +292,6 @@ const useExtendedOrderDetails = ({
299292
}
300293
return this.isBuyerConfirmedOrder && (this.isBuyOrder ? this.isMyAd : !this.isMyAd);
301294
},
302-
get shouldShowOrderFooter() {
303-
return (
304-
this.shouldShowCancelAndPaidButton ||
305-
this.shouldShowComplainAndReceivedButton ||
306-
this.shouldShowOnlyComplainButton ||
307-
this.shouldShowOnlyReceivedButton
308-
);
309-
},
310295
get shouldShowOrderTimer() {
311296
if (this.isFinalisedOrder) return false;
312297
return this.isPendingOrder || this.isOngoingOrder;

0 commit comments

Comments
 (0)