fix: toggle in right-click menu not updating

This commit is contained in:
WDaan 2022-12-30 11:53:44 +01:00
parent b090984e5a
commit 91fcfeeba6
2 changed files with 6 additions and 5 deletions

View file

@ -283,7 +283,7 @@ export default {
name: 'TorrentRightClickMenu',
mixins: [General, TorrentSelect],
props: {
torrent: Object,
hash: String,
touchmode: Boolean,
x: Number
},
@ -323,7 +323,7 @@ export default {
}
},
computed: {
...mapGetters(['getCategories', 'getAvailableTags']),
...mapGetters(['getCategories', 'getAvailableTags', 'getTorrent']),
...mapState(['selected_torrents']),
availableCategories() {
const categories = [{ name: 'None', value: '' }]
@ -345,6 +345,9 @@ export default {
},
multiple() {
return this.selected_torrents.length > 1
},
torrent() {
return this.getTorrent(this.hash)
}
},
watch: {
@ -403,8 +406,6 @@ export default {
setTag(tag) {
if (this.torrent.tags && this.torrent.tags.includes(tag)) this.removeTag(tag)
else this.addTag(tag)
console.log(this.torrent)
},
addTag(tag) {
qbit.addTorrentTag(this.hashes, tag)

View file

@ -136,7 +136,7 @@
</div>
</div>
<v-menu v-model="trcMenu.show" transition="slide-y-transition" :position-x="trcMenu.X" :position-y="trcMenu.Y" absolute>
<TorrentRightClickMenu v-if="data" :torrent="data.torrent" :touchmode="tmCalc.TouchMode" :x="trcMenu.X" />
<TorrentRightClickMenu v-if="data" :hash="data.torrent.hash" :touchmode="tmCalc.TouchMode" :x="trcMenu.X" />
</v-menu>
</div>
</template>