From 49bf2f069456cb0551d74fe9f0e88bb424fc3da5 Mon Sep 17 00:00:00 2001 From: CzBiX Date: Sat, 13 May 2023 17:22:02 +0800 Subject: [PATCH] fix torrents by tag, fix #158 --- src/store/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/store/index.ts b/src/store/index.ts index 366eaea..0d411f4 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -13,6 +13,7 @@ import searchEngineStore from './searchEngine'; import { RootState } from './types'; import stateMerge from '@/utils/vue-object-merge'; import api from '@/Api'; +import { Torrent } from '@/types' Vue.use(Vuex); @@ -122,11 +123,11 @@ const store = new Vuex.Store({ return groupBy(getters.allTorrents, torrent => torrent.category); }, torrentGroupByTag(state, getters) { - const result: any = {} + const result: Record = {} for (const torrent of getters.allTorrents) { - const tags: any[] = torrent.tags.split(","); + const tags: string[] = torrent.tags.split(', '); tags.forEach(tag => { - let list: any[] = result[tag] + let list: Torrent[] = result[tag] if (!list) { list = [] result[tag] = list;