Skip to content

Commit

Permalink
Fix migartion popup (#2219)
Browse files Browse the repository at this point in the history
* Add more loags

* Fix

* Poup
  • Loading branch information
harsh-mn-yral authored Jun 4, 2024
1 parent 52b9a03 commit 728a231
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
23 changes: 14 additions & 9 deletions packages/web-client/src/lib/helpers/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,23 +496,28 @@ type NotificationResponse =
endOfList: boolean
}

async function transformHistoryRecords(
function transformHistoryRecords(
res: Array<[bigint, TokenEvent]>,
_filter?: UnionKeyOf<MintEvent>,
): Promise<TransactionHistory[]> {
): TransactionHistory[] {
const history: TransactionHistory[] = []

res.forEach((o) => {
console.log({ o })
const event = o[1]
console.log({ event })
const type = Object.keys(event)[0] as UnionKeyOf<TokenEvent>
console.log({ type })
const subType = Object.keys(event[type].details)[0] as WalletEventType
const details = (event[type] as WalletEvent)?.[
subType
] as WalletEventSubDetails
const eventOutcome = Object.keys(
details?.['event_outcome'] || {},
)[0] as EventOutcome
console.log({ o, type, event, subType, details, eventOutcome })
console.log({ subType })
const details = (event[type] as WalletEvent)?.[subType] as
| WalletEventSubDetails
| undefined
console.log({ details })
const eventOutcome = Object.keys(details?.['event_outcome'] || {})[0] as
| EventOutcome
| undefined
console.log({ eventOutcome })
history.push({
id: o[0],
type,
Expand Down
9 changes: 6 additions & 3 deletions packages/web-client/src/routes/(feed)/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Selector from '@hnn/components/home/Selector.svelte'
import { page } from '$app/stores'
import { playerState } from '$lib/stores/app'
import { onDestroy, onMount } from 'svelte'
import { authState } from '$lib/stores/auth'
import { authState, loadingAuthStatus } from '$lib/stores/auth'
import IconButton from '@hnn/components/button/IconButton.svelte'
import { browser } from '$app/environment'
import { showMigrationPopup } from '$lib/stores/popups'
Expand All @@ -32,6 +32,9 @@ onDestroy(() => {
})
$: pathname = $page.url.pathname
$: showPopup =
$showMigrationPopup && !$loadingAuthStatus && !$authState.isMigrated
</script>

<HomeLayout>
Expand Down Expand Up @@ -65,7 +68,7 @@ $: pathname = $page.url.pathname
{/if}
</div>
</HomeLayout>

<!-- {#if $showMigrationPopup}
<!--
{#if showPopup}
<MigrationPopup on:click={() => showMigrationPopup.set(false)} />
{/if} -->
24 changes: 12 additions & 12 deletions packages/web-client/src/routes/(feed)/wallet/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,18 @@ onMount(() => ($showMigrationPopup = true))
</div>
<div class="opacity-70 pt-4 text-center">No transactions yet</div>
{/each}
{#if $authState.isMigrated}
<div
class="absolute inset-0 top-[5.5rem] flex w-full flex-col items-center justify-start !border-0 py-20 backdrop-blur-md">
Your account has been transferred to yral. Go ahead and explore the
app <a
target="_blank"
class="font-bold text-[#E2017B] underline"
href="https://yral.com">
yral.com
</a>
</div>
{/if}
{/if}
{#if $authState.isMigrated}
<div
class="absolute inset-0 top-[5.5rem] flex w-full flex-col items-center justify-start !border-0 py-20 backdrop-blur-md">
Your account has been transferred to yral. Go ahead and explore the
app <a
target="_blank"
class="font-bold text-[#E2017B] underline"
href="https://yral.com">
yral.com
</a>
</div>
{/if}
</div>
</div>
Expand Down

0 comments on commit 728a231

Please sign in to comment.