Loading
web-installer: do not depend on undefined behavior within Controller.next()
This code does not work the way it was intended to.
isConnected() depends on getDevice() which is not implemented anywhere.
It thus evaluates to `undefined`.
!undefined is `true` and !!undefined is `false`.
Consider following code:
if (this.deviceManager.isConnected() && !this.inInMode(next.mode)) {
When code was working this would evaluate to:
if (undefined && !this.inInMode(next.mode)) {
When we changed isConnected to return boolean with !! trick it evaluated !!undefined which is false.
So the code became
if (false && !this.inInMode(next.mode)) {
It short-circuts and never evaluates right hand side and breaks mode switching.
Remove isConnected() entirely and restore working logic.