diff --git a/lib/gui/app/models/store.ts b/lib/gui/app/models/store.ts index e7575997..e05552da 100644 --- a/lib/gui/app/models/store.ts +++ b/lib/gui/app/models/store.ts @@ -124,7 +124,7 @@ function storeReducer( }); } - const drives = action.data; + let drives = action.data; if (!_.isArray(drives) || !_.every(drives, _.isObject)) { throw errors.createError({ @@ -132,6 +132,13 @@ function storeReducer( }); } + drives = _.sortBy(drives, [ + // Devices with no devicePath first (usbboot) + d => !!d.devicePath, + // Then sort by devicePath (only available on Linux with udev) or device + d => d.devicePath || d.device, + ]); + const newState = state.set('availableDrives', Immutable.fromJS(drives)); const selectedDevices = newState.getIn(['selection', 'devices']).toJS();