Skip to content

Commit

Permalink
🚸 调整兑换码判断
Browse files Browse the repository at this point in the history
  • Loading branch information
BTMuli committed Jan 25, 2025
1 parent 44d181b commit 87ff3a1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/components/app/t-gameNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ const codeData = shallowRef<TGApp.BBS.Navigator.CodeData[]>([]);
const showOverlay = ref<boolean>(false);
const actId = ref<string>();
const hasNav = computed<boolean>(() => {
if (props.modelValue !== 2) return false;
return nav.value.find((item) => item.name === "前瞻直播") !== undefined;
const hasNav = computed<TGApp.BBS.Navigator.Navigator | undefined>(() => {
if (props.modelValue !== 2) return undefined;
return nav.value.find((item) => item.name === "前瞻直播" || item.name === "直播兑换码");
});
onMounted(async () => await loadNav());
Expand All @@ -54,9 +54,8 @@ async function loadNav(): Promise<void> {
async function tryGetCode(): Promise<void> {
if (props.modelValue !== 2) return;
const navFind = nav.value.find((item) => item.name === "前瞻直播");
if (!navFind) return;
const actIdFind = new URL(navFind.app_path).searchParams.get("act_id");
if (!hasNav.value) return;
const actIdFind = new URL(hasNav.value.app_path).searchParams.get("act_id");
if (!actIdFind) {
showSnackbar.warn("未找到活动ID");
return;
Expand Down

0 comments on commit 87ff3a1

Please sign in to comment.