실시간 차트 보조지표 탭 문제 수정
This commit is contained in:
@@ -19,6 +19,21 @@ export function singleIndParamKey(i: IndicatorConfig): string {
|
||||
return `${JSON.stringify(i.params)}|${(i.plots ?? []).map(p => p.id).sort().join(',')}|${i.mergedWith ?? ''}`;
|
||||
}
|
||||
|
||||
/** 차트에 로드된 지표 id 중 현재 설정에 없는(이전 탭 잔존) 항목이 있는지 */
|
||||
export function chartHasStaleIndicators(
|
||||
loadedIds: Set<string>,
|
||||
indicators: IndicatorConfig[],
|
||||
): boolean {
|
||||
if (loadedIds.size === 0) return false;
|
||||
const expected = new Set(
|
||||
indicators.filter(i => i.hidden !== true).map(i => i.id),
|
||||
);
|
||||
for (const id of loadedIds) {
|
||||
if (!expected.has(id)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** 이전·현재 지표 목록 차이를 분류해 최소 갱신 경로를 선택 */
|
||||
export function classifyIndicatorChartChange(
|
||||
prev: IndicatorConfig[],
|
||||
|
||||
Reference in New Issue
Block a user