| 524 | } | 524 | } |
| 525 | | 525 | |
| 526 | let saveChanges = false; | 526 | let saveChanges = false; |
| | 527 | const sortByViewOrder = (a, b) => Object.keys(FANCY_NAMES).indexOf(a) - Object.keys(FANCY_NAMES).indexOf(b); |
| 527 | const commands = profile.mode === 'cc' ? CC_COMMANDS : TC_COMMANDS; | 528 | const commands = profile.mode === 'cc' ? CC_COMMANDS : TC_COMMANDS; |
| 528 | const settings = commands.reduce((acc, command) => { | 529 | const settings = commands.slice().sort(sortByViewOrder).reduce((acc, command) => { |
| 529 | const fancyName = FANCY_NAMES[command]; | 530 | const fancyName = FANCY_NAMES[command]; |
| 530 | acc[fancyName] = !profile.exclude.includes(command); | 531 | acc[fancyName] = !profile.exclude.includes(command); |
| 531 | return acc; | 532 | return acc; |