mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2024-11-28 13:08:53 +03:00
fix(dashboard): Sort not working anymore (#1211)
This commit is contained in:
parent
ee03b5cb58
commit
b2bbcb987e
2 changed files with 11 additions and 2 deletions
|
@ -3,6 +3,7 @@ import { SortOptions } from '@/constants/qbit/SortOptions'
|
|||
import { formatData } from '@/helpers'
|
||||
import { useMaindataStore } from '@/stores/maindata'
|
||||
import { useVueTorrentStore } from '@/stores/vuetorrent'
|
||||
import { GetTorrentPayload } from '@/types/qbit/payloads'
|
||||
import { defineStore } from 'pinia'
|
||||
import { computed, reactive, ref, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
@ -65,6 +66,13 @@ export const useDashboardStore = defineStore(
|
|||
}
|
||||
})
|
||||
|
||||
const getTorrentsPayload = computed<GetTorrentPayload>(() => {
|
||||
return {
|
||||
sort: sortOptions.isCustomSortEnabled ? SortOptions.DEFAULT : sortOptions.sortBy,
|
||||
reverse: sortOptions.reverseOrder
|
||||
}
|
||||
})
|
||||
|
||||
function isTorrentInSelection(hash: string) {
|
||||
return selectedTorrents.value.includes(hash)
|
||||
}
|
||||
|
@ -141,7 +149,8 @@ export const useDashboardStore = defineStore(
|
|||
spanTorrentSelection,
|
||||
selectAllTorrents,
|
||||
unselectAllTorrents,
|
||||
toggleSelect
|
||||
toggleSelect,
|
||||
getTorrentsPayload
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -163,7 +163,7 @@ export const useMaindataStore = defineStore('maindata', () => {
|
|||
|
||||
// fetch torrent data
|
||||
dashboardStore.sortOptions.isCustomSortEnabled = torrentBuilder.computedValues.indexOf(dashboardStore.sortOptions.sortBy) !== -1
|
||||
let data = await qbit.getTorrents()
|
||||
let data = await qbit.getTorrents(dashboardStore.getTorrentsPayload)
|
||||
|
||||
if (vueTorrentStore.showTrackerFilter) {
|
||||
trackers.value = data
|
||||
|
|
Loading…
Reference in a new issue