Skip to content

Commit 48ebd28

Browse files
authored
Merge pull request #2255 from numbersprotocol/fix-generate-result-url-from-asset-id-clean-commits
generate Result URL from capture id
2 parents 2272b1c + 6611409 commit 48ebd28

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

src/app/features/home/activities/network-action-order-details/network-action-order-details.page.html

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,18 @@ <h4 id="network-action-name">{{ order.network_app_name_text }}</h4>
4949
<ion-label>{{ t('resultUrl') }}:</ion-label>
5050
</ion-col>
5151
<ion-col class="wrap-text" align="end">
52-
<ion-label (click)="openResultUrl(order.result_url_text)">
53-
<a *ngIf="order.result_url_text !== undefined">
54-
{{ order.result_url_text }}
55-
</a>
56-
<ion-text *ngIf="order.result_url_text === undefined">{{
57-
t('noResultUrlAvailable')
58-
}}</ion-text>
52+
<ion-label
53+
*ngIf="order.result_url_text !== undefined"
54+
(click)="openResultUrl(order.result_url_text)"
55+
>
56+
<a> {{ order.result_url_text }} </a>
57+
</ion-label>
58+
59+
<ion-label
60+
*ngIf="order.result_url_text === undefined"
61+
(click)="openResultUrl(resultUrlFromAssetId(order.asset_id_text))"
62+
>
63+
<a> {{ resultUrlFromAssetId(order.asset_id_text) }} </a>
5964
</ion-label>
6065
</ion-col>
6166
<ion-col size="1"> </ion-col>

src/app/features/home/activities/network-action-order-details/network-action-order-details.page.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { catchError, first, map } from 'rxjs/operators';
99
import { OrderHistoryService } from '../../../../shared/actions/service/order-history.service';
1010
import { ErrorService } from '../../../../shared/error/error.service';
1111
import { isNonNullable } from '../../../../utils/rx-operators/rx-operators';
12+
import { getAssetProfileForCaptureIframe } from '../../../../utils/url';
1213

1314
const { Browser, Clipboard } = Plugins;
1415
@UntilDestroy({ checkProperties: true })
@@ -42,13 +43,15 @@ export class NetworkActionOrderDetailsPage {
4243
// eslint-disable-next-line class-methods-use-this
4344
openResultUrl(url: string) {
4445
if (url) {
45-
Browser.open({
46-
url: `${url}`,
47-
toolbarColor: '#564dfc',
48-
});
46+
Browser.open({ url, toolbarColor: '#000000' });
4947
}
5048
}
5149

50+
// eslint-disable-next-line class-methods-use-this
51+
resultUrlFromAssetId(assetId: string) {
52+
return getAssetProfileForCaptureIframe(assetId);
53+
}
54+
5255
async copyToClipboard(value: string) {
5356
await Clipboard.write({ string: value });
5457
this.snackBar.open(

src/app/utils/url.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { BUBBLE_IFRAME_URL } from '../shared/dia-backend/secret';
12
import { urlToDownloadApp } from './constants';
23
import { MimeType } from './mime-type';
34

@@ -19,6 +20,10 @@ export function getAssetProfileForNSE(id: string, token?: string) {
1920
return `https://nftsearch.site/asset-profile?cid=${id}`;
2021
}
2122

23+
export function getAssetProfileForCaptureIframe(cid: string) {
24+
return `${BUBBLE_IFRAME_URL}/asset_page?nid=${cid}`;
25+
}
26+
2227
export function getAppDownloadLink(isPlatform: (platformName: any) => boolean) {
2328
if (isPlatform('ios'))
2429
return 'https://apps.apple.com/en/app/capture-app/id1536388009';

0 commit comments

Comments
 (0)