알림목록 종목별 정렬시 시간별로 정렬되도록 수정

This commit is contained in:
Macbook
2026-06-03 11:33:18 +09:00
parent 5ced979212
commit c228f18c25
5 changed files with 92 additions and 27 deletions
@@ -13,6 +13,7 @@ import {
toUpbitMarket,
} from '../../utils/backtestUiUtils';
import { getKoreanName } from '../../utils/marketNameCache';
import { compareMarketSymbol, compareTimeAsc } from '../../utils/tradeListSort';
export type ExecutionListTab = 'backtest' | 'live';
export type BacktestListSort = 'strategy' | 'symbol' | 'return';
@@ -58,7 +59,13 @@ export default function BacktestExecutionList({
const sortedBacktests = useMemo(() => {
const list = [...backtestRecords];
if (sort === 'strategy') list.sort((a, b) => (a.strategyName ?? '').localeCompare(b.strategyName ?? ''));
else if (sort === 'symbol') list.sort((a, b) => a.symbol.localeCompare(b.symbol));
else if (sort === 'symbol') {
list.sort((a, b) => {
const bySymbol = compareMarketSymbol(a.symbol, b.symbol);
if (bySymbol !== 0) return bySymbol;
return compareTimeAsc(a.createdAt, b.createdAt);
});
}
else list.sort((a, b) => (b.totalReturn ?? 0) - (a.totalReturn ?? 0));
return list;
}, [backtestRecords, sort]);
@@ -117,7 +124,13 @@ export default function BacktestExecutionList({
<p className="btd-sidebar-hint"> ·<br /> .</p>
</div>
) : (
liveItems.map(item => {
[...liveItems]
.sort((a, b) => {
const bySymbol = compareMarketSymbol(a.symbol, b.symbol);
if (bySymbol !== 0) return bySymbol;
return compareTimeAsc(a.createdAt, b.createdAt);
})
.map(item => {
const positive = item.totalReturnPct >= 0;
const active = selectedLiveId === item.id;
const market = toUpbitMarket(item.symbol);