NTP-3187 | AS | recreation of timer on data change fix (#12446)
This commit is contained in:
@@ -37,8 +37,8 @@ constructor(val countDownHelper: ICountDownHelper, val timerStrategyFactory: Tim
|
||||
) {
|
||||
super.Render(property, uiTronData, uiTronViewModel, modifier)
|
||||
val countDownTimerData = uiTronData as? CountDownTextData
|
||||
var timeLeft by remember { mutableStateOf(countDownTimerData?.timeLeft) }
|
||||
|
||||
var timeLeft by
|
||||
remember(countDownTimerData?.timeLeft) { mutableStateOf(countDownTimerData?.timeLeft) }
|
||||
val textData by
|
||||
remember(timeLeft) {
|
||||
mutableStateOf(
|
||||
@@ -72,7 +72,7 @@ constructor(val countDownHelper: ICountDownHelper, val timerStrategyFactory: Tim
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
LaunchedEffect(countDownTimerData?.timeLeft) {
|
||||
countDownHelper.cancelTimer(property.layoutId.orEmpty())
|
||||
countDownHelper.startTimer(
|
||||
timerId = property.layoutId.orEmpty(),
|
||||
|
||||
Reference in New Issue
Block a user