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

View File

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