Skip to content

Commit

Permalink
refactor: pretty case format extruder names
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
  • Loading branch information
pedrolamas committed Feb 17, 2025
1 parent 3edbeb7 commit 7a8a2e7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/store/printer/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,11 @@ export const getters: GetterTree<PrinterState, RootState> = {
const extruderKeys = Object.keys(state.printer)
.filter((key): key is ExtruderKey => /^extruder\d{0,2}$/.test(key))
.sort((a, b) => +a.substring(8) - +b.substring(8))
const hasMultipleExtruders = extruderKeys.length > 1

return extruderKeys
.map((key, index) => ({
.map(key => ({
key,
name: hasMultipleExtruders ? `Extruder ${index}` : 'Extruder'
name: Vue.$filters.prettyCase(key),
}))
},

Expand Down

0 comments on commit 7a8a2e7

Please # to comment.