Skip to content

Commit

Permalink
refactor: remove unnecessary return statements in search.vue and vote… (
Browse files Browse the repository at this point in the history
#84)

refactor: remove unnecessary return statements in search.vue and vote.vue
  • Loading branch information
garyellow authored May 11, 2024
1 parent f90fe69 commit 7e938db
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
3 changes: 0 additions & 3 deletions pages/admin/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ const searchVoter = async () => {
message: "查無此人",
type: "warning",
});
return;
});
};
Expand All @@ -260,7 +259,6 @@ const searchToken = async () => {
message: "無此憑證或投票尚未結束",
type: "warning",
});
return;
});
};
Expand All @@ -285,7 +283,6 @@ const searchVG = async () => {
message: "投票尚未結束",
type: "warning",
});
return;
});
};
</script>
42 changes: 22 additions & 20 deletions pages/vote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@
>
{{ votingItem.name }}
</div>
<div
class="flex flex-col justify-end align-middle"
>
<div class="flex flex-col justify-end align-middle">
<ClientOnly>
<ElTooltip
placement="right"
Expand Down Expand Up @@ -230,7 +228,7 @@
>
<template #header>
<div
class="mb-3 ml-4 -mr-3 cursor-default text-balance break-words text-lg font-bold md:text-xl"
class="-mr-3 mb-3 ml-4 cursor-default text-balance break-words text-lg font-bold md:text-xl"
>
{{ votingItem.name }}
</div>
Expand Down Expand Up @@ -634,17 +632,23 @@ const seeResult = async (index: number) => {
customStyle: {
fontFamily: '"Noto Sans TC", sans-serif',
},
}).catch(async (action: Action) => {
if (action === "cancel") {
await navigator.clipboard.writeText(data.value!.tokens[index]);
ElMessage({
type: "success",
message: "已複製",
});
} else {
return;
}
});
})
.then(async () => {
resultLoading.value[index] = false;
await useRouter().push("/result/" + index);
})
.catch(async (action: Action) => {
if (action === "cancel") {
await navigator.clipboard.writeText(data.value!.tokens[index]);
ElMessage({
type: "success",
message: "已複製",
});
resultLoading.value[index] = false;
await useRouter().push("/result/" + index);
}
});
} else {
await ElMessageBox.alert("無投票憑證", "未投票", {
confirmButtonText: "確 定",
Expand All @@ -654,13 +658,11 @@ const seeResult = async (index: number) => {
customStyle: {
fontFamily: '"Noto Sans TC", sans-serif',
},
}).catch(() => {
return;
}).then(async () => {
resultLoading.value[index] = false;
await useRouter().push("/result/" + index);
});
}
resultLoading.value[index] = false;
await useRouter().push("/result/" + index);
};
const checkData = () => {
Expand Down

1 comment on commit 7e938db

@vercel
Copy link

@vercel vercel bot commented on 7e938db May 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ntpusu-vote – ./

ntpusu-vote-git-main-ntpusu.vercel.app
ntpusu-vote.vercel.app
ntpusu-vote-ntpusu.vercel.app

Please sign in to comment.