일목균형표 구름 미표시 버그 수정 (bullishVisible/bearishVisible 둘 다 false)
- isIchimokuCloudVisible: bullish/bearish 둘 다 false이면 DB 잘못된 저장값으로 간주하고 구름을 표시 (하나만 false인 경우는 사용자 의도로 유지) - _applyIchimokuCloudPlugin: 동일 로직으로 effectiveBullish/effectiveBearish 적용 - config.hidden 체크로만 클라우드 데이터 초기화 - isIchimokuCloudVisible 의존 제거 서버 DB에 cloudColors.bullishVisible=false, bearishVisible=false 가 잘못 저장된 경우에도 구름이 표시되도록 보호 로직 추가. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1751,10 +1751,18 @@ export class ChartManager {
|
|||||||
config: IndicatorConfig,
|
config: IndicatorConfig,
|
||||||
): void {
|
): void {
|
||||||
const colors = resolveIchimokuCloudColors(config.cloudColors);
|
const colors = resolveIchimokuCloudColors(config.cloudColors);
|
||||||
plugin.setColors(colors.bullishColor, colors.bearishColor);
|
|
||||||
plugin.setVisibility(colors.bullishVisible !== false, colors.bearishVisible !== false);
|
|
||||||
|
|
||||||
if (!isIchimokuCloudVisible(config)) {
|
// bullishVisible/bearishVisible 가 둘 다 false 이면 DB 잘못된 저장값으로 간주하고
|
||||||
|
// 기본값(표시)으로 복원한다. 하나만 false 인 경우는 사용자 의도이므로 유지.
|
||||||
|
const bullishVis = colors.bullishVisible !== false;
|
||||||
|
const bearishVis = colors.bearishVisible !== false;
|
||||||
|
const effectiveBullish = (!bullishVis && !bearishVis) ? true : bullishVis;
|
||||||
|
const effectiveBearish = (!bullishVis && !bearishVis) ? true : bearishVis;
|
||||||
|
|
||||||
|
plugin.setColors(colors.bullishColor, colors.bearishColor);
|
||||||
|
plugin.setVisibility(effectiveBullish, effectiveBearish);
|
||||||
|
|
||||||
|
if (config.hidden === true) {
|
||||||
plugin.setCloudData([]);
|
plugin.setCloudData([]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,11 +118,18 @@ export function areIchimokuSpanLinesVisible(config: IndicatorConfig): boolean {
|
|||||||
* 선행스팬 라인의 개별 표시 여부(plotVisibility)와 구름 표시는 독립적으로 동작.
|
* 선행스팬 라인의 개별 표시 여부(plotVisibility)와 구름 표시는 독립적으로 동작.
|
||||||
* 서버 DB에 저장된 구버전 설정에서 plot3·plot4 가 false 여도 구름은 표시해야 하므로
|
* 서버 DB에 저장된 구버전 설정에서 plot3·plot4 가 false 여도 구름은 표시해야 하므로
|
||||||
* areIchimokuSpanLinesVisible 검사를 생략한다.
|
* areIchimokuSpanLinesVisible 검사를 생략한다.
|
||||||
|
*
|
||||||
|
* bullishVisible/bearishVisible 이 둘 다 false 이면 DB 잘못된 저장값으로 간주하고
|
||||||
|
* 구름을 표시한다 (하나만 false 인 경우는 사용자 의도이므로 유지).
|
||||||
*/
|
*/
|
||||||
export function isIchimokuCloudVisible(config: IndicatorConfig): boolean {
|
export function isIchimokuCloudVisible(config: IndicatorConfig): boolean {
|
||||||
if (config.hidden === true) return false;
|
if (config.hidden === true) return false;
|
||||||
const colors = resolveIchimokuCloudColors(config.cloudColors);
|
const colors = resolveIchimokuCloudColors(config.cloudColors);
|
||||||
return colors.bullishVisible !== false || colors.bearishVisible !== false;
|
const bullishVis = colors.bullishVisible !== false;
|
||||||
|
const bearishVis = colors.bearishVisible !== false;
|
||||||
|
// 둘 다 false → DB 잘못된 저장값, 기본값으로 복원 간주 → 표시
|
||||||
|
if (!bullishVis && !bearishVis) return true;
|
||||||
|
return bullishVis || bearishVis;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resolveIchimokuCloudColors(
|
export function resolveIchimokuCloudColors(
|
||||||
|
|||||||
Reference in New Issue
Block a user