From eba06a213919fef98c8349a7d642a11cc1df6079 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Thu, 26 Oct 2017 12:05:59 -0400 Subject: [PATCH] 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 --- lib/shared/sdk/usbboot/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/shared/sdk/usbboot/index.js b/lib/shared/sdk/usbboot/index.js index dfb32efe..efa895b8 100644 --- a/lib/shared/sdk/usbboot/index.js +++ b/lib/shared/sdk/usbboot/index.js @@ -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