Commit cf1f9fbb authored by Christophe Deschamps's avatar Christophe Deschamps
Browse files

Avoid creating new device actions upon rotation

parent 0d4846fc
...@@ -43,6 +43,7 @@ import org.linhome.entities.Action ...@@ -43,6 +43,7 @@ import org.linhome.entities.Action
import org.linhome.store.DeviceStore import org.linhome.store.DeviceStore
import org.linhome.ui.validators.ValidatorFactory import org.linhome.ui.validators.ValidatorFactory
import org.linhome.utils.DialogUtil import org.linhome.utils.DialogUtil
import org.linhome.utils.cdlog
class DeviceEditorFragment : GenericFragment() { class DeviceEditorFragment : GenericFragment() {
...@@ -71,11 +72,13 @@ class DeviceEditorFragment : GenericFragment() { ...@@ -71,11 +72,13 @@ class DeviceEditorFragment : GenericFragment() {
model.device = args.device model.device = args.device
if (model.device == null) { if (model.actionsViewModels.isEmpty()) {
addAction(null) if (model.device == null) {
} else { addAction(null)
model.device!!.actions?.forEach { } else {
addAction(it) model.device!!.actions?.forEach {
addAction(it)
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment