mirror of
https://github.com/aljazceru/hypergolic.git
synced 2025-12-18 14:04:21 +01:00
problem: can't see merit request solution text
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
import { Alert } from '@/components/ui/alert';
|
||||
import { currentUser } from '@/stores/session';
|
||||
import MeritComment from './MeritComment.svelte';
|
||||
import { Description } from 'formsnap';
|
||||
|
||||
export let merit: MeritRequest;
|
||||
//export let rocket: NDKEvent;
|
||||
@@ -118,9 +119,9 @@
|
||||
<div class="flex flex-nowrap justify-between">
|
||||
<Card.Title>
|
||||
{merit.Problem().split('\n')[0]}
|
||||
</Card.Title>{#if merit.Solution()}<a
|
||||
</Card.Title>{#if merit.SolutionURL()}<a
|
||||
class="flex flex-nowrap text-orange-500 underline decoration-orange-500"
|
||||
href={merit.Solution()}>View Solution <ExternalLink size={18} class="m-1" /></a
|
||||
href={merit.SolutionURL()}>View Solution <ExternalLink size={18} class="m-1" /></a
|
||||
>{/if}
|
||||
</div>
|
||||
<div class="flex flex-nowrap">
|
||||
@@ -131,7 +132,12 @@
|
||||
/>
|
||||
<Name ndk={$ndk} pubkey={merit.Pubkey} class="inline-block max-w-32 truncate p-2" />
|
||||
</div>
|
||||
{#if merit.SolutionText()}
|
||||
{merit.SolutionText()?.trim()}
|
||||
{/if}
|
||||
<Card.Description></Card.Description>
|
||||
</Card.Header>
|
||||
|
||||
<Card.Content class="p-6 text-sm">
|
||||
<div class="grid gap-3">
|
||||
<div class="font-semibold">Merit Request Details</div>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
.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() : ''}`;
|
||||
let content = `I've voted to ratify your merit request! ${merit.Problem()} \n\n ${merit.SolutionURL() ? merit.SolutionURL() : ''}`;
|
||||
prepareMeritNoteEvent({
|
||||
ndk,
|
||||
merit,
|
||||
|
||||
@@ -23,7 +23,7 @@ export class MeritRequest {
|
||||
}
|
||||
return _problem;
|
||||
}
|
||||
Solution(): URL | undefined {
|
||||
SolutionURL(): URL | undefined {
|
||||
let _solution: URL | undefined = undefined;
|
||||
for (let solution of this.Event.getMatchingTags('solution')) {
|
||||
if (solution && solution.length > 2 && solution[1] == 'url') {
|
||||
@@ -34,6 +34,15 @@ export class MeritRequest {
|
||||
}
|
||||
return _solution;
|
||||
}
|
||||
SolutionText(): string | undefined {
|
||||
let _solution: string | undefined = undefined;
|
||||
for (let solution of this.Event.getMatchingTags('solution')) {
|
||||
if (solution && solution.length > 2 && solution[1] == 'text') {
|
||||
_solution = solution[2];
|
||||
}
|
||||
}
|
||||
return _solution;
|
||||
}
|
||||
IncludedInRocketState(rocket: Rocket): boolean {
|
||||
let included = rocket.ApprovedMeritRequests();
|
||||
return Boolean(included.get(this.ID));
|
||||
|
||||
Reference in New Issue
Block a user