mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
style(GUI): improve ordering of supported extensions (#806)
The new ordering of the main supported extensions will be: `img`, `iso`, `zip`. We make use of `_.intersection` in order to ensure that the values we're hardcoding indeed exist in the list of all supported format extensions, otherwise they won't appear at all. This ensures we never show extensions that are not supported. Partly fixes: https://github.com/resin-io/etcher/issues/787 Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org> Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit is contained in:
parent
428dbeaf55
commit
9ed6e30b00
@ -26,7 +26,11 @@ module.exports = function(SupportedFormatsModel, SelectionStateModel, AnalyticsS
|
||||
* @type {String[]}
|
||||
* @public
|
||||
*/
|
||||
this.mainSupportedExtensions = _.slice(SupportedFormatsModel.getAllExtensions(), 0, 3);
|
||||
this.mainSupportedExtensions = _.intersection([
|
||||
'img',
|
||||
'iso',
|
||||
'zip'
|
||||
], SupportedFormatsModel.getAllExtensions());
|
||||
|
||||
/**
|
||||
* @summary Extra supported extensions
|
||||
@ -37,7 +41,7 @@ module.exports = function(SupportedFormatsModel, SelectionStateModel, AnalyticsS
|
||||
this.extraSupportedExtensions = _.difference(
|
||||
SupportedFormatsModel.getAllExtensions(),
|
||||
this.mainSupportedExtensions
|
||||
);
|
||||
).sort();
|
||||
|
||||
/**
|
||||
* @summary Select image
|
||||
|
Loading…
x
Reference in New Issue
Block a user