diff --git a/src/components/CreateMeritRequest.svelte b/src/components/CreateMeritRequest.svelte index 01d0419..8a93a8b 100644 --- a/src/components/CreateMeritRequest.svelte +++ b/src/components/CreateMeritRequest.svelte @@ -12,11 +12,12 @@ import type NDKSvelte from '@nostr-dev-kit/ndk-svelte'; import { Terminal } from 'lucide-svelte'; import Todo from './Todo.svelte'; - import { isValidUrl } from '@/event_helpers/rockets'; + import { isValidUrl, Rocket } from '@/event_helpers/rockets'; import CalculateSats from './CalculateSats.svelte'; import { isGitHubUrl, parseProblem } from '@/helpers'; + import Login from './Login.svelte'; - export let rocketEvent: NDKEvent; + export let rocket: Rocket; let problem: string = ''; let solution: string = ''; @@ -78,17 +79,29 @@ e.created_at = Math.floor(new Date().getTime() / 1000); e.tags.push(['problem', 'text', problem]); if (solution.length > 0) { - e.tags.push(['solution', 'url', solution]); + try { + let url = new URL(solution); + e.tags.push(['solution', 'url', url.toString()]); + } catch { + e.tags.push(['solution', 'text', solution]); + } } - e.tags.push(['a', `31108:${rocketEvent.pubkey}:${rocketEvent.dTag}`]); + e.tags.push(['a', `31108:${rocket.Event.pubkey}:${rocket.Event.dTag}`]); e.tags.push(['merits', merits.toString(10)]); e.tags.push(['sats', sats]); console.log(e.rawEvent()); - e.publish().then((x) => { - console.log(x); - open = false; - //goto(`${base}/rockets/${getRocketURL(e)}`); - }); + e.publish() + .then((x) => { + console.log(x); + console.log('todo: publish a kind 1 and tag the rocket and author'); + open = false; + //goto(`${base}/rockets/${getRocketURL(e)}`); + }) + .catch(() => { + alert( + "something went wrong, copy/paste your data and refresh then try again if you don't see your merit request in the rocket dashboard (we r so early, there will be blugs)" + ); + }); } @@ -140,7 +153,7 @@ (sats = event.detail)} /> -
+ - {#if wts} +
- + {#if $currentUser} + + {:else} + + {/if} { let map = new Map(); @@ -96,6 +97,7 @@ Merit Requests + @@ -138,13 +140,12 @@ - {/each} {#if $merits.size > $meritsTruncated.length} { - truncate.set(false) + truncate.set(false); }} class="m-2 flex w-48 flex-nowrap text-lg" >View {$merits.size - $meritsTruncated.length} more { @@ -158,8 +158,14 @@
Analysis
- A competent freelance developer earns $70 CuckLoserBucks an hour (on average). Using - this rate, the contributor is claiming to have spent about {referenceTime} working on this. +

+ To make it easier to compare the value of each contribution we normalize the hourly + rate to $50 CuckLoserBucks an hour. +

+

+ At this rate, the contributor is claiming to have worked for {referenceTime} solving + this problem. +

@@ -170,8 +176,8 @@
Votes
{#if $votes.size == 0}Waiting for existing {parsedRocket.Name()} Merit - holders to voteWaiting for existing {parsedRocket.Name()} Merit holders + to vote {/if} @@ -221,6 +227,9 @@ {:else if !result} {/if} + console.log(merit.Event.rawEvent())} + >print to console diff --git a/src/components/RocketDashboard.svelte b/src/components/RocketDashboard.svelte index 89c380f..23cd362 100644 --- a/src/components/RocketDashboard.svelte +++ b/src/components/RocketDashboard.svelte @@ -2,8 +2,9 @@ import * as Breadcrumb from '$lib/components/ui/breadcrumb/index.js'; import Button from '@/components/ui/button/button.svelte'; import * as Card from '@/components/ui/card'; + import { Rocket } from '@/event_helpers/rockets'; import type { NDKEvent } from '@nostr-dev-kit/ndk'; - import CreateMeritRequest from './CreateMeritRequest.svelte'; + import BitcoinAssociations from './AssociatedBitcoinAddresses.svelte'; import CreateNewProduct from './CreateNewProduct.svelte'; import MeritRequests from './MeritRequests.svelte'; import MeritsAndSatflow from './MeritsAndSatflow.svelte'; @@ -11,8 +12,6 @@ import ProposedProducts from './ProposedProducts.svelte'; import Todo from './Todo.svelte'; import UpdateMission from './UpdateMission.svelte'; - import { Rocket } from '@/event_helpers/rockets'; - import BitcoinAssociations from './AssociatedBitcoinAddresses.svelte'; export let rocket: NDKEvent; @@ -50,7 +49,6 @@ -