...
This commit is contained in:
@@ -60,7 +60,7 @@ fun StockDetailSection(
|
||||
|
||||
// 이전 종목 코드를 기억하기 위한 상태
|
||||
var previousCode by remember { mutableStateOf("") }
|
||||
var latestPrice by remember { mutableStateOf("0") }
|
||||
var lastPrice by remember { mutableStateOf("0") }
|
||||
|
||||
|
||||
// 종목 변경 시 데이터 로드 및 웹소켓 구독 관리
|
||||
@@ -90,7 +90,7 @@ fun StockDetailSection(
|
||||
val price = tradeLog.price
|
||||
wsManager.tradeLogs.add(tradeLog)
|
||||
if (wsManager.tradeLogs.size > 50) wsManager.tradeLogs.removeLast()
|
||||
println("code $code ,price $price")
|
||||
// println("code $code ,price $price")
|
||||
val currentPrice = price
|
||||
if (chartData.isNotEmpty() && currentPrice != "0") {
|
||||
val priceDouble = currentPrice.replace(",", "").toDoubleOrNull() ?: 0.0
|
||||
@@ -123,7 +123,7 @@ fun StockDetailSection(
|
||||
chartData = chartData.dropLast(1) + updatedCandle
|
||||
}
|
||||
}
|
||||
latestPrice = currentPrice
|
||||
lastPrice = currentPrice
|
||||
}
|
||||
|
||||
}
|
||||
@@ -218,7 +218,7 @@ fun StockDetailSection(
|
||||
code = stockCode,
|
||||
isDomestic = isDomestic,
|
||||
previousClose = previousClose,
|
||||
openPrice = latestPrice,
|
||||
openPrice = lastPrice,
|
||||
resultMessage = resultMessage,
|
||||
resultMessageClear = {resultMessage = ""},
|
||||
isSuccess = isSuccess
|
||||
@@ -227,10 +227,10 @@ fun StockDetailSection(
|
||||
// 실시간 가격 표시 (WebSocket 데이터)
|
||||
Column(horizontalAlignment = Alignment.End) {
|
||||
Text(
|
||||
text = "${latestPrice} 원",
|
||||
text = "${lastPrice} 원",
|
||||
style = MaterialTheme.typography.h4,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = if (latestPrice?.contains("-") ?: false) Color.Blue else Color.Red
|
||||
color = if (lastPrice?.contains("-") ?: false) Color.Blue else Color.Red
|
||||
)
|
||||
Text("실시간 체결가", style = MaterialTheme.typography.caption, color = Color.Gray)
|
||||
}
|
||||
@@ -276,7 +276,7 @@ fun StockDetailSection(
|
||||
stockCode = stockCode,
|
||||
stockName = stockName,
|
||||
isDomestic = isDomestic,
|
||||
currentPrice = latestPrice,
|
||||
currentPrice = lastPrice,
|
||||
holdingQuantity = holdingQuantity,
|
||||
tradeService = tradeService,
|
||||
onOrderSaved = onOrderSaved,
|
||||
|
||||
Reference in New Issue
Block a user