Fix updating settings on page change

This commit is contained in:
Matti Viljanen 2020-04-26 18:22:19 +03:00
parent 71f8f93223
commit c0e8004cc2
No known key found for this signature in database
GPG key ID: CF32A1495158F888

View file

@ -25,7 +25,7 @@ Page {
Timer { Timer {
id: settingsTimer id: settingsTimer
interval: 10 interval: 16
repeat: false repeat: false
onTriggered: { onTriggered: {
// The only setting that can change outside this page // The only setting that can change outside this page
@ -34,8 +34,12 @@ Page {
} }
} }
onStatusChanged: {
if(status === PageStatus.Activating)
settingsTimer.start()
}
Component.onCompleted: { Component.onCompleted: {
// These we can read only once
autoStopCharging.checked = settings.limitEnabled autoStopCharging.checked = settings.limitEnabled
highLimitSlider.value = settings.highLimit highLimitSlider.value = settings.highLimit
lowLimitSlider.value = settings.lowLimit lowLimitSlider.value = settings.lowLimit