Skip to content

Commit

Permalink
Fix initial items in TargetPacketItemChooser
Browse files Browse the repository at this point in the history
This fixes the bug where PacketViewer appeared to not remember the last
selected packet in the default config
  • Loading branch information
ryan-pratt committed Jan 2, 2025
1 parent b7b6bb1 commit 4b7d72c
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,24 @@ export default {
},
},
watch: {
initialTargetName: function (val) {
// These three "initial" watchers are here in case the parent component doesn't figure out its inital values
// until after this component has already been created. All this logic incl. the "on-set" events could be
// simplified with a refactor to use named v-models, but that's probably a significant breaking change.
if (val) {
this.selectedTargetName = val.toUpperCase()
}
},
initialPacketName: function (val) {
if (val) {
this.selectedPacketName = val.toUpperCase()
}
},
initialItemName: function (val) {
if (val) {
this.selectedItemName = val.toUpperCase()
}
},
mode: function (newVal, oldVal) {
this.selectedPacketName = null
this.selectedItemName = null
Expand Down

0 comments on commit 4b7d72c

Please sign in to comment.