mirror of
https://github.com/Qortal/q-trade.git
synced 2025-06-21 13:31:21 +00:00
fix duplicates
This commit is contained in:
parent
00634bca04
commit
51cacc55c9
@ -57,7 +57,7 @@ import {
|
||||
|
||||
export const baseLocalHost = window.location.host;
|
||||
// export const baseLocalHost = "devnet-nodes.qortal.link:11111";
|
||||
// export const baseLocalHost = "127.0.0.1:12391";
|
||||
// export const baseLocalHost = "127.0.0.1:22391";
|
||||
|
||||
import CloseIcon from "@mui/icons-material/Close";
|
||||
import ContentCopyIcon from "@mui/icons-material/ContentCopy";
|
||||
@ -208,15 +208,15 @@ export const TradeOffers: React.FC<any> = ({
|
||||
isFetchingName.current[address] = true
|
||||
const response = await requestQueueGetNames.enqueue(
|
||||
() => {
|
||||
return fetch("/names/address/" + address);
|
||||
return fetch("/names/primary/" + address);
|
||||
}
|
||||
);
|
||||
const nameData = await response.json();
|
||||
if (nameData?.length > 0) {
|
||||
if (nameData?.name) {
|
||||
setQortalNames((prev) => {
|
||||
return {
|
||||
...prev,
|
||||
[address]: nameData[0].name,
|
||||
[address]: nameData.name,
|
||||
};
|
||||
});
|
||||
} else {
|
||||
@ -476,7 +476,15 @@ export const TradeOffers: React.FC<any> = ({
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
offeringTrades.current = Object.values(
|
||||
offeringTrades.current.reduce((acc, trade) => {
|
||||
const key = trade.qortalAtAddress;
|
||||
if (!acc[key] || trade.timestamp > acc[key].timestamp) {
|
||||
acc[key] = trade;
|
||||
}
|
||||
return acc;
|
||||
}, {} as Record<string, typeof offeringTrades.current[number]>)
|
||||
);
|
||||
let filteredOffers =
|
||||
offeringTrades.current?.filter((offeringTrade) =>
|
||||
filterOffersUsingTradePresence(offeringTrade)
|
||||
|
@ -37,13 +37,13 @@ export default function HistoryList({ qortAddress, historyList }) {
|
||||
|
||||
const getName = async (address) => {
|
||||
try {
|
||||
const response = await fetch("/names/address/" + address);
|
||||
const response = await fetch("/names/primary/" + address);
|
||||
const nameData = await response.json();
|
||||
if (nameData?.length > 0) {
|
||||
if (nameData?.name) {
|
||||
setQortalNames((prev) => {
|
||||
return {
|
||||
...prev,
|
||||
[address]: nameData[0].name,
|
||||
[address]: nameData.name,
|
||||
};
|
||||
});
|
||||
} else {
|
||||
|
@ -363,7 +363,6 @@ const StuckOrders = ({setOpenStuckOrders})=> {
|
||||
const timestampB = b?.timestamp ?? b?.creationTimestamp ?? 0;
|
||||
return timestampB - timestampA; // Newest first
|
||||
});
|
||||
|
||||
return (
|
||||
<BootstrapDialog
|
||||
aria-labelledby="customized-dialog-title"
|
||||
|
@ -167,7 +167,6 @@ export default function TradeBotList({ qortAddress, failedTradeBots }) {
|
||||
setTradeBotList(sellTrades);
|
||||
tradeBotListRef.current = sellTrades;
|
||||
};
|
||||
|
||||
const restartTradeOffers = () => {
|
||||
if (socketRef.current) {
|
||||
socketRef.current.close(1000, "forced"); // Close with a custom reason
|
||||
|
@ -64,8 +64,8 @@ export default function UnsignedFees({ qortAddress }) {
|
||||
}, [])
|
||||
|
||||
|
||||
const restartUnsignedFeeSocket = () => {
|
||||
getUnsignedFees()
|
||||
const restartUnsignedFeeSocket = (address) => {
|
||||
getUnsignedFees(address)
|
||||
setTimeout(() => initUnsignedFeeSocket(true), 50);
|
||||
};
|
||||
|
||||
@ -106,7 +106,7 @@ export default function UnsignedFees({ qortAddress }) {
|
||||
if (event.reason === "forced") {
|
||||
return;
|
||||
}
|
||||
restartUnsignedFeeSocket();
|
||||
restartUnsignedFeeSocket(qortAddressRef.current);
|
||||
};
|
||||
socketRef.current.onerror = (e) => {
|
||||
clearTimeout(socketTimeout);
|
||||
|
Loading…
x
Reference in New Issue
Block a user