style(usbboot): wait before scanning drives after the file server phase (#1799)

This is a workaround to prevent the USB device from disappearing after
the file server phase, until the resulting block device comes up.

By adding a delay after the file server phase, we prevent the USB
scanner from getting triggered again, therefore keeping the current USB
device visible in the drive selector modal.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This commit is contained in:
Juan Cruz Viotti 2017-10-26 12:05:59 -04:00 committed by GitHub
parent daa847d29b
commit eba06a2139

View File

@ -273,6 +273,11 @@ class USBBootAdapter extends EventEmitter {
}
result.progress = this.progress[result.raw]
if (result.progress === utils.PERCENTAGE_MAXIMUM) {
return Bluebird.delay(DEVICE_REBOOT_DELAY).return(result)
}
return result
// See http://bluebirdjs.com/docs/api/promise.map.html