Skip to content

Commit

Permalink
fix: explorer link for vesting outputs (#7723)
Browse files Browse the repository at this point in the history
  • Loading branch information
begonaalvarezd authored Nov 16, 2023
1 parent 9528333 commit c9559f0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
47 changes: 26 additions & 21 deletions packages/desktop/components/popups/ActivityDetailsPopup.svelte
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
<script lang="ts">
import { PopupId, closePopup, openPopup } from '@auxiliary/popup'
import { openUrlInBrowser } from '@core/app'
import { localize } from '@core/i18n'
import { ExplorerEndpoint } from '@core/network'
import { getOfficialExplorerUrl } from '@core/network/utils'
import {
Text,
Button,
FontWeight,
TextType,
BasicActivityDetails,
AliasActivityDetails,
FoundryActivityDetails,
GovernanceActivityDetails,
NftActivityDetails,
ConsolidationActivityDetails,
ActivityInformation,
} from 'shared/components'
import { openUrlInBrowser } from '@core/app'
import { activeProfile, checkActiveProfileAuth } from '@core/profile'
import { setClipboard, truncateString } from '@core/utils'
import {
ActivityAsyncStatus,
ActivityDirection,
Expand All @@ -23,13 +14,21 @@
rejectActivity,
selectedAccountActivities,
} from '@core/wallet'
import { activeProfile, checkActiveProfileAuth } from '@core/profile'
import { setClipboard } from '@core/utils'
import { truncateString } from '@core/utils'
import { closePopup, openPopup, PopupId } from '@auxiliary/popup'
import { onMount } from 'svelte'
import { ExplorerEndpoint } from '@core/network'
import {
ActivityInformation,
AliasActivityDetails,
BasicActivityDetails,
Button,
ConsolidationActivityDetails,
FontWeight,
FoundryActivityDetails,
GovernanceActivityDetails,
NftActivityDetails,
Text,
TextType,
} from 'shared/components'
import { TextHintVariant } from 'shared/components/enums'
import { onMount } from 'svelte'
export let activityId: string
export let _onMount: (..._: any[]) => Promise<void> = async () => {}
Expand All @@ -45,7 +44,13 @@
activity?.asyncData?.asyncStatus === ActivityAsyncStatus.Unclaimed
function onExplorerClick(): void {
openUrlInBrowser(`${explorerUrl}/${ExplorerEndpoint.Transaction}/${activity?.transactionId}`)
let url: string
if (activity?.type === ActivityType.Vesting) {
url = `${explorerUrl}/${ExplorerEndpoint.Output}/${activity?.outputId}`
} else {
url = `${explorerUrl}/${ExplorerEndpoint.Transaction}/${activity?.transactionId}`
}
openUrlInBrowser(url)
}
function onTransactionIdClick(): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export enum ExplorerEndpoint {
Transaction = 'transaction',
Nft = 'nft',
Output = 'output',
}

0 comments on commit c9559f0

Please sign in to comment.