Skip to content

Commit

Permalink
feat: 订阅列表的流量信息兼容远程和本地合并的情况, 排除设置了不查询订阅信息的链接
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Mar 8, 2024
1 parent d348b83 commit cc881bc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store-front-end",
"version": "2.14.152",
"version": "2.14.153",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
3 changes: 2 additions & 1 deletion src/components/SubListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ const collectionDetail = computed(() => {
const flow = computed(() => {
if (props.type === "sub") {
const urlList = Object.keys(flows.value);
if (props.sub.source === "local") return t("subPage.subItem.local");
const localOnly = props.sub.source === 'local' && !['localFirst', 'remoteFirst'].includes(props.sub.mergeSources)
if (localOnly) return t("subPage.subItem.local");
if (isFlowFetching.value && !urlList.includes(props.sub.url))
return t("subPage.subItem.loading");
Expand Down
1 change: 1 addition & 0 deletions src/types/store/subsStore.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ interface Sub {
source: 'remote' | 'local';
icon?: string;
ua?: string;
mergeSources?: string;
process: Process[];
}

Expand Down
3 changes: 2 additions & 1 deletion src/utils/getFlowsUrlList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ export const getFlowsUrlList = (subs: Sub[]): string[][] => {
const urlList = [];

subs.forEach(sub => {
if (!urlList.includes(sub.url) && sub.source === 'remote' && sub.url) {
const localOnly = sub.source === 'local' && !['localFirst', 'remoteFirst'].includes(sub.mergeSources)
if (sub.url && !localOnly && !urlList.includes(sub.url)) {
urlList.push(sub.url);
nameList.push([sub.url, sub.name]);
}
Expand Down

0 comments on commit cc881bc

Please sign in to comment.