problem: we are publishing vote note even if vote failed

This commit is contained in:
gsovereignty
2024-08-14 14:13:12 +08:00
parent 119ac5d2d2
commit 216c4edf17
2 changed files with 101 additions and 101 deletions

View File

@@ -131,6 +131,7 @@
/> />
<Name ndk={$ndk} pubkey={merit.Pubkey} class="inline-block max-w-32 truncate p-2" /> <Name ndk={$ndk} pubkey={merit.Pubkey} class="inline-block max-w-32 truncate p-2" />
</div> </div>
</Card.Header>
<Card.Content class="p-6 text-sm"> <Card.Content class="p-6 text-sm">
<div class="grid gap-3"> <div class="grid gap-3">
<div class="font-semibold">Merit Request Details</div> <div class="font-semibold">Merit Request Details</div>
@@ -149,8 +150,7 @@
<span class="text-muted-foreground"> <span class="text-muted-foreground">
Approximate value of {merit.Sats.toLocaleString()} sats in CuckLoserBucks Approximate value of {merit.Sats.toLocaleString()} sats in CuckLoserBucks
</span> </span>
<span>${cuckPrice ? ((merit.Sats / 100000000) * cuckPrice).toFixed(2) : 'Loading'}</span <span>${cuckPrice ? ((merit.Sats / 100000000) * cuckPrice).toFixed(2) : 'Loading'}</span>
>
</li> </li>
</ul> </ul>
<Separator class="my-4" /> <Separator class="my-4" />
@@ -163,8 +163,8 @@
rate to $50 CuckLoserBucks an hour. rate to $50 CuckLoserBucks an hour.
</p> </p>
<p class="m-1 text-justify"> <p class="m-1 text-justify">
At this rate, the contributor is claiming to have worked for {referenceTime} solving At this rate, the contributor is claiming to have worked for {referenceTime} solving this
this problem. problem.
</p> </p>
</span> </span>
</div> </div>
@@ -215,9 +215,12 @@
{/each} {/each}
</Table.Body> </Table.Body>
</Table.Root> </Table.Root>
</div></Card.Content </div>
<a href="#" class="text-xs" on:click={() => console.log(merit.Event.rawEvent())}
>print to console</a
></Card.Content
> >
</Card.Header>
<Card.Footer class="flex flex-row justify-center border-t px-6 py-3 text-center {background}"> <Card.Footer class="flex flex-row justify-center border-t px-6 py-3 text-center {background}">
{#if merit.IncludedInRocketState(parsedRocket)} {#if merit.IncludedInRocketState(parsedRocket)}
<span class="scroll-m-20 text-lg font-semibold tracking-tight md:text-xl">APPROVED</span> <span class="scroll-m-20 text-lg font-semibold tracking-tight md:text-xl">APPROVED</span>
@@ -227,9 +230,6 @@
{:else if !result} {:else if !result}
<VoteOnMeritRequest {merit} rocket={parsedRocket} /> <VoteOnMeritRequest {merit} rocket={parsedRocket} />
{/if} {/if}
<a href="#" class="text-xs" on:click={() => console.log(merit.Event.rawEvent())}
>print to console</a
>
</Card.Footer> </Card.Footer>
</Card.Root> </Card.Root>

View File

@@ -32,7 +32,6 @@
.publish() .publish()
.then((x) => { .then((x) => {
console.log(x); console.log(x);
});
if (direction === 'ratify') { if (direction === 'ratify') {
let content = `I've voted to ratify your merit request! ${merit.Problem()} \n\n ${merit.Solution() ? merit.Solution() : ''}`; let content = `I've voted to ratify your merit request! ${merit.Problem()} \n\n ${merit.Solution() ? merit.Solution() : ''}`;
prepareMeritNoteEvent({ prepareMeritNoteEvent({
@@ -45,6 +44,7 @@
console.log(x); console.log(x);
}); });
} }
});
} }
$: currentUserHasVotepower = false; $: currentUserHasVotepower = false;