Skip to content

Commit

Permalink
fix: 尝试修复订阅丢失
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Mar 19, 2024
1 parent 7ddb9e2 commit 7db8c5d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 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.199",
"version": "2.14.201",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
8 changes: 7 additions & 1 deletion src/components/SubListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
</span>
</template>
<template v-else>
<span v-if="flow.secondLine" style="font-weight: normal">
<span v-if="flow && flow.secondLine" style="font-weight: normal">
{{ flow.firstLine + ' | ' + flow.secondLine }}
</span>
<span v-else style="font-weight: normal">
Expand Down Expand Up @@ -299,6 +299,12 @@ const flow = computed(() => {
secondLine: ``,
};
}
if (!target?.status) {
return {
firstLine: t("subPage.subItem.flowError"),
secondLine: ``,
};
}
if (target.status === "noFlow") {
return {
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export default {
noRecord: 'Refresh to get usage',
noFlow: 'No flow',
noFlowInfo: 'No flow info',
flowError: 'Failed to get usage',
noExpiresInfo: 'No expires info',
},
deleteSub: {
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export default {
noRecord: '刷新后可获取流量情况',
noFlow: '不查询流量',
noFlowInfo: '无流量信息',
flowError: '无法获取流量信息',
noExpiresInfo: '无有效期信息',
},
deleteSub: {
Expand Down
7 changes: 5 additions & 2 deletions src/store/subs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ export const useSubsStore = defineStore('subsStore', {
if (noFlow) {
this.flows[url] = { status:'noFlow' };
} else {
const { data } = await subsApi.getFlow(name);
this.flows[url] = {...data, hideExpire };
try {
const { data } = await subsApi.getFlow(name);
this.flows[url] = {...data, hideExpire };
} catch (e) {
}
}
};
// const subs = sub || this.subs;
Expand Down
1 change: 1 addition & 0 deletions src/views/editCode/cmView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ const pasteNav = async () => {
margin-top: 8px;
color: var(--comment-text-color);
// position: absolute;
cursor: pointer;
}
.cm-img-button button:hover {
transform: scale(0.9);
Expand Down

0 comments on commit 7db8c5d

Please sign in to comment.