Skip to content

Commit

Permalink
refactor: use more generic name to detected vote privacy
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Mar 8, 2024
1 parent e26ab0f commit 39036c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 4 additions & 6 deletions apps/ui/src/components/ProposalResults.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ const results = computed(() =>
.sort((a, b) => b.progress - a.progress)
);
const shutterActive = computed(
() => props.proposal.privacy === 'shutter' && !props.proposal.completed
);
const isEncrypted = computed(() => props.proposal.privacy && !props.proposal.completed);
</script>

<template>
Expand All @@ -57,7 +55,7 @@ const shutterActive = computed(
>
<div class="truncate mr-2 z-10">{{ choice }}</div>
<div class="z-10">
<span v-if="shutterActive">
<span v-if="isEncrypted">
<UiTooltip
class="cursor-help"
title="This proposal has Shutter privacy enabled. All votes will be encrypted until the voting period has ended and the final score is calculated"
Expand Down Expand Up @@ -101,7 +99,7 @@ const shutterActive = computed(
</div>

<UiTooltip
v-if="shutterActive"
v-if="isEncrypted"
class="cursor-help"
title="This proposal has Shutter privacy enabled. All votes will be encrypted until the voting period has ended and the final score is calculated"
>
Expand All @@ -126,7 +124,7 @@ const shutterActive = computed(
</div>
</div>
<div
v-if="!shutterActive"
v-if="!isEncrypted"
class="rounded-full h-1.5 overflow-hidden"
:style="{
width: withDetails ? '100%' : `${width}px`
Expand Down
6 changes: 2 additions & 4 deletions apps/ui/src/views/Proposal/Votes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ const votingPowerDecimals = computed(() => {
0
);
});
const shutterActive = computed(
() => props.proposal.privacy === 'shutter' && !props.proposal.completed
);
const isEncrypted = computed(() => props.proposal.privacy && !props.proposal.completed);
function reset() {
votes.value = [];
Expand Down Expand Up @@ -213,7 +211,7 @@ watch([sortBy, choiceFilter], () => {
</td>
<td class="relative">
<UiTooltip
v-if="shutterActive"
v-if="isEncrypted"
class="cursor-help"
title="This proposal has Shutter privacy enabled. All votes will be encrypted until the voting period has ended and the final score is calculated"
>
Expand Down

0 comments on commit 39036c0

Please sign in to comment.