diff --git a/src/components/Dashboard/TRC/RightClickMenu.vue b/src/components/Dashboard/TRC/RightClickMenu.vue index bf221b53..d885bcb5 100644 --- a/src/components/Dashboard/TRC/RightClickMenu.vue +++ b/src/components/Dashboard/TRC/RightClickMenu.vue @@ -94,15 +94,15 @@ async function copyValue(valueToCopy: string) { } function setDownloadLimit() { - dialogStore.createDialog(SpeedLimitDialog, { hash: hash.value, mode: 'download' }) + dialogStore.createDialog(SpeedLimitDialog, { hashes: hashes.value, mode: 'download' }) } function setUploadLimit() { - dialogStore.createDialog(SpeedLimitDialog, { hash: hash.value, mode: 'upload' }) + dialogStore.createDialog(SpeedLimitDialog, { hashes: hashes.value, mode: 'upload' }) } function setShareLimit() { - dialogStore.createDialog(ShareLimitDialog, { hash: hash.value }) + dialogStore.createDialog(ShareLimitDialog, { hashes: hashes.value }) } async function exportTorrents() { diff --git a/src/components/Dialogs/ShareLimitDialog.vue b/src/components/Dialogs/ShareLimitDialog.vue index 05c0711d..cc94c4f1 100644 --- a/src/components/Dialogs/ShareLimitDialog.vue +++ b/src/components/Dialogs/ShareLimitDialog.vue @@ -9,7 +9,7 @@ const DISABLED = -1 const props = defineProps<{ guid: string - hash: string + hashes: string[] }>() const { isOpened } = useDialog(props.guid) @@ -38,13 +38,13 @@ function close() { async function submit() { switch (shareType.value) { case 'global': - await maindataStore.setShareLimit([props.hash], GLOBAL, GLOBAL, GLOBAL) + await maindataStore.setShareLimit(props.hashes, GLOBAL, GLOBAL, GLOBAL) break case 'disabled': - await maindataStore.setShareLimit([props.hash], DISABLED, DISABLED, DISABLED) + await maindataStore.setShareLimit(props.hashes, DISABLED, DISABLED, DISABLED) break case 'enabled': - await maindataStore.setShareLimit([props.hash], + await maindataStore.setShareLimit(props.hashes, ratioLimitEnabled.value ? ratioLimit.value : DISABLED, seedingTimeLimitEnabled.value ? seedingTimeLimit.value : DISABLED, inactiveSeedingTimeLimitEnabled.value ? inactiveSeedingTimeLimit.value : DISABLED) @@ -54,7 +54,7 @@ async function submit() { } onBeforeMount(async () => { - const torrent = torrentStore.getTorrentByHash(props.hash) + const torrent = torrentStore.getTorrentByHash(props.hashes[0]) if (!torrent) { return close() } @@ -131,4 +131,4 @@ onBeforeMount(async () => { <style scoped> -</style> \ No newline at end of file +</style> diff --git a/src/components/Dialogs/SpeedLimitDialog.vue b/src/components/Dialogs/SpeedLimitDialog.vue index b3891457..a68e90ba 100644 --- a/src/components/Dialogs/SpeedLimitDialog.vue +++ b/src/components/Dialogs/SpeedLimitDialog.vue @@ -5,7 +5,7 @@ import { onBeforeMount, ref } from 'vue' const props = defineProps<{ guid: string - hash: string + hashes: string[] mode: 'download' | 'upload' }>() @@ -24,17 +24,17 @@ async function submit() { const formattedValue = Math.max(0, value.value) * 1000 switch (props.mode) { case 'download': - await maindataStore.setDownloadLimit(formattedValue, [props.hash]) + await maindataStore.setDownloadLimit(formattedValue, props.hashes) break case 'upload': - await maindataStore.setUploadLimit(formattedValue, [props.hash]) + await maindataStore.setUploadLimit(formattedValue, props.hashes) break } close() } onBeforeMount(async () => { - const torrent = torrentStore.getTorrentByHash(props.hash) + const torrent = torrentStore.getTorrentByHash(props.hashes[0]) if (!torrent) { return close() } @@ -76,4 +76,4 @@ onBeforeMount(async () => { <style scoped> -</style> \ No newline at end of file +</style>