Skip to content

Commit

Permalink
Minor Name Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Step7750 committed May 21, 2024
1 parent d62aaac commit 9967ea1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lib/alarms/csfloat_trade_pings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Trade} from '../types/float_market';
import {FetchPendingTrades} from '../bridge/handlers/fetch_pending_trades';
import {pingTradeHistory} from './trade_history';
import {pingCancelPingTradeOffers, pingSentTradeOffers} from './trade_offer';
import {pingCancelTrades, pingSentTradeOffers} from './trade_offer';
import {HasPermissions} from '../bridge/handlers/has_permissions';
import {PingExtensionStatus} from '../bridge/handlers/ping_extension_status';

Expand Down Expand Up @@ -55,7 +55,7 @@ export async function pingTradeStatus() {
}

try {
await pingCancelPingTradeOffers(pendingTrades);
await pingCancelTrades(pendingTrades);
} catch (e) {
console.error('failed to ping cancel ping trade offers', e);
}
Expand Down
5 changes: 3 additions & 2 deletions src/lib/alarms/trade_offer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export async function pingSentTradeOffers(pendingTrades: Trade[]) {
}
}

export async function pingCancelPingTradeOffers(pendingTrades: Trade[]) {
export async function pingCancelTrades(pendingTrades: Trade[]) {
const hasWaitForCancelPing = pendingTrades.find((e) => e.state === TradeState.PENDING && e.wait_for_cancel_ping);
if (!hasWaitForCancelPing) {
// Nothing to process/ping, exit
Expand All @@ -89,9 +89,10 @@ export async function pingCancelPingTradeOffers(pendingTrades: Trade[]) {
if (
tradeOffer &&
(tradeOffer.state === TradeOfferState.Active ||
tradeOffer.state === TradeOfferState.Accepted ||
tradeOffer.state === TradeOfferState.CreatedNeedsConfirmation)
) {
// The trade offer is still active or needs confirmation, we don't want to send a cancel ping
// We don't want to send a cancel ping if the offer is active or valid
continue;
}

Expand Down

0 comments on commit 9967ea1

Please sign in to comment.