fix: prevent duplicates (#464)

refactor: don't use regex

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
th33xitus 2021-12-10 00:06:27 +01:00 committed by GitHub
parent 648bbe581e
commit 36b8acdcd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,7 @@ export default class PressureAdvanceSettings extends Mixins(BaseMixin) {
get all_extruders(): string[] {
Object.keys(this.$store.state.printer).forEach((e) => {
(e.match(/^(extruder)\d*$/)) ? this.extruders.push(e) : {}
if (e.startsWith('extruder') && !this.extruders.includes(e)) this.extruders.push(e)
})
this.extruders.length === 1 ? this.resetToActiveExtruder() : {}