Skip to content

Commit

Permalink
chore: simplify tempchart dataset filter
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed May 15, 2022
1 parent e34c34c commit 2dc98aa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/store/printer/tempHistory/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ export const actions: ActionTree<PrinterTempHistoryState, RootState> = {
const masterDatasetKeys = tempDatasetKeys
.filter((tmp) => {
if (tmp.startsWith('_')) return false
if (tmp.lastIndexOf('-') > -1) {
const suffix = tmp.slice(tmp.lastIndexOf('-') + 1)
return !['target', 'power', 'speed'].includes(suffix)
}

return true
const lastIndex = tmp.lastIndexOf('-')
if (lastIndex === -1) return true

const suffix = tmp.slice(lastIndex + 1)
return !['target', 'power', 'speed'].includes(suffix)
})
.sort()
const series: PrinterTempHistoryStateSerie[] = []
Expand Down

0 comments on commit 2dc98aa

Please sign in to comment.