From dcd9f26289e0a7db3fc01c956a483cae2d94f878 Mon Sep 17 00:00:00 2001 From: harshbaz Date: Sun, 17 Sep 2023 12:38:57 +0530 Subject: [PATCH 1/6] Update api response --- packages/web-client/src/lib/helpers/airdrop.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/web-client/src/lib/helpers/airdrop.ts b/packages/web-client/src/lib/helpers/airdrop.ts index f4f32047e..7ba6d9090 100644 --- a/packages/web-client/src/lib/helpers/airdrop.ts +++ b/packages/web-client/src/lib/helpers/airdrop.ts @@ -13,6 +13,8 @@ export async function airdropEntryDetails(principalId: string) { return body.doc as { FinalCOYNWalletBalance: string FinalHotTokens: number + splitNeuronId?: string + nnsId?: string } } return false From 6bd9edd90acd3f6c37fce67ba2fa44e7f0a8d649 Mon Sep 17 00:00:00 2001 From: harshbaz Date: Sun, 17 Sep 2023 12:39:07 +0530 Subject: [PATCH 2/6] Add type --- packages/web-client/src/lib/utils/sleep.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web-client/src/lib/utils/sleep.ts b/packages/web-client/src/lib/utils/sleep.ts index 3c633b855..f243ac905 100644 --- a/packages/web-client/src/lib/utils/sleep.ts +++ b/packages/web-client/src/lib/utils/sleep.ts @@ -1,3 +1,3 @@ -export default function sleep(ms) { +export default function sleep(ms: number) { return new Promise((resolve) => setTimeout(resolve, ms)) } From bca759ca892344949132005b6663241fbcc62ab5 Mon Sep 17 00:00:00 2001 From: harshbaz Date: Sun, 17 Sep 2023 12:39:23 +0530 Subject: [PATCH 3/6] Add transfer details --- packages/web-client/src/routes/airdrop/+page.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/web-client/src/routes/airdrop/+page.svelte b/packages/web-client/src/routes/airdrop/+page.svelte index 2a973ae1e..739e952de 100644 --- a/packages/web-client/src/routes/airdrop/+page.svelte +++ b/packages/web-client/src/routes/airdrop/+page.svelte @@ -20,6 +20,10 @@ let wallet = { hot: 0, loading: true, } +let transferDetails = { + nnsId: '', + neuronId: '', +} async function checkIfCompleted() { if ($authState.idString) { @@ -29,6 +33,8 @@ async function checkIfCompleted() { } else { wallet.coyn = res?.FinalCOYNWalletBalance wallet.hot = res?.FinalHotTokens + res.splitNeuronId && (transferDetails.neuronId = res.splitNeuronId) + res.nnsId && (transferDetails.nnsId = res.nnsId) wallet.loading = false participatedForAirdrop = true const nns = await isNNSIdRegistered($authState.idString) From 0673e65084010cc8c3e565dda5b1c08422af0b66 Mon Sep 17 00:00:00 2001 From: harshbaz Date: Sun, 17 Sep 2023 12:41:48 +0530 Subject: [PATCH 4/6] Show transfer details if exist --- .../src/routes/airdrop/+page.svelte | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/packages/web-client/src/routes/airdrop/+page.svelte b/packages/web-client/src/routes/airdrop/+page.svelte index 739e952de..722a7d4c1 100644 --- a/packages/web-client/src/routes/airdrop/+page.svelte +++ b/packages/web-client/src/routes/airdrop/+page.svelte @@ -100,12 +100,23 @@ $: !authorized && (loading = false) {/if} -
- The HOT tokens will be transferred to your NNS wallet by our team - over the course of a few months as we go through the process - manually with over 16,000 winners. Please be patient and check our - socials for updates. -
+ {#if transferDetails.nnsId && transferDetails.neuronId} +
+ Your reward has been transferred to your NNS dapp account with + ID {transferDetails.nnsId}. The neuron ID is + + {transferDetails.neuronId} + + . +
+ {:else} +
+ The HOT tokens will be transferred to your NNS wallet by our + team over the course of a few months as we go through the + process manually with over 16,000 winners. Please be patient and + check our socials for updates. +
+ {/if} From f68437e5220c575ce95e6e4c1d40dfc9302e8bcb Mon Sep 17 00:00:00 2001 From: harshbaz Date: Sun, 17 Sep 2023 13:14:58 +0530 Subject: [PATCH 5/6] Forward paste event --- packages/web-client/src/components/input/Input.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/web-client/src/components/input/Input.svelte b/packages/web-client/src/components/input/Input.svelte index 702c3a17a..22bffe50c 100644 --- a/packages/web-client/src/components/input/Input.svelte +++ b/packages/web-client/src/components/input/Input.svelte @@ -30,4 +30,5 @@ onMount(() => { on:change on:focus on:blur - class="grow border-none py-3 px-4 focus:ring-transparent disabled:opacity-50 {exportClass}" /> + on:paste + class="grow border-none px-4 py-3 focus:ring-transparent disabled:opacity-50 {exportClass}" /> From 578b662fb4712151ebda084e63f2077b96e9bc62 Mon Sep 17 00:00:00 2001 From: harshbaz Date: Sun, 17 Sep 2023 13:15:02 +0530 Subject: [PATCH 6/6] Disable paste --- .../web-client/src/routes/profile/[id]/edit/+page.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/web-client/src/routes/profile/[id]/edit/+page.svelte b/packages/web-client/src/routes/profile/[id]/edit/+page.svelte index 55056913e..2032930c9 100644 --- a/packages/web-client/src/routes/profile/[id]/edit/+page.svelte +++ b/packages/web-client/src/routes/profile/[id]/edit/+page.svelte @@ -16,7 +16,6 @@ import { goto } from '$app/navigation' import { registerEvent } from '$components/analytics/GA.svelte' import { individualUser, userIndex } from '$lib/helpers/backend' import goBack from '$lib/utils/goBack' -import Icon from '$components/icon/Icon.svelte' export let data: PageData @@ -86,7 +85,7 @@ async function saveChanges() { } else if (!usernameRegex.test(values.username.trim())) { error = 'Username not allowed' loading = false - Log({ error }, 'warn') + Log('warn', 'Username not allowed') return } else if (!username_set && (await isUsernameTaken())) { error = 'This username is already taken' @@ -219,6 +218,7 @@ $: userId = username_set disabled={loading} bind:value={values.name} type="text" + on:paste={(e) => e.preventDefault()} maxlength={40} placeholder="Enter your name here" class="w-full rounded-md bg-white/10 py-4" /> @@ -230,6 +230,7 @@ $: userId = username_set bind:value={values.username} on:keydown={filterUsernameKeystrokes} type="text" + on:paste={(e) => e.preventDefault()} maxlength={20} placeholder="Enter your username here" class="placeholder:norma w-full rounded-md bg-white/10 py-4 lowercase placeholder:normal-case" />