Skip to content

Commit

Permalink
feat: clear filter if QR-selected spool isn't in filtered results
Browse files Browse the repository at this point in the history
Signed-off-by: Mathis Mensing <[email protected]>
  • Loading branch information
matmen committed Jul 28, 2023
1 parent db03190 commit 0d6d026
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/widgets/spoolman/SpoolSelectionDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,14 @@ export default class SpoolSelectionDialog extends Mixins(StateMixin, BrowserMixi
handleQRCodeDetected (id: number) {
this.cameraScanSource = null
this.selectedSpoolId = id
if (
!this.availableSpools
.filter(spool => this.filterResults('', this.search, spool))
.some(spool => spool.id === id)
) {
// clear filter if selected spool isn't in filter results
this.search = ''
}
}
async handleSelectSpool () {
Expand Down

0 comments on commit 0d6d026

Please sign in to comment.