Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set projectapikey with file upload #82

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/@api/file.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@
formData.append('file', <Blob>item.postFile);
formData.append('member', memberId);
formData.append('uid', item.file.uid);
formData.append('projectApiKey', environment.build5Token);
const origin = environment.production ? BUILD5_PROD_ADDRESS_API : BUILD5_TEST_ADDRESS_API;
return this.httpClient
.post(origin + WEN_FUNC.uploadFile, formData)
.pipe(
map((b: any) => {

Check warning on line 55 in src/app/@api/file.api.ts

View workflow job for this annotation

GitHub Actions / front_end_es_lint

Unexpected any. Specify a different type
if (item.onSuccess) {
item.onSuccess(b.url, item.file, b.url);
}
Expand Down
16 changes: 2 additions & 14 deletions src/app/components/wallet-deeplink/wallet-deeplink.component.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
<div class="flex flex-col items-center justify-center w-full lg:flex-row lg:w-auto">
<a
nz-button
*ngIf="bloomDeepLink"
[href]="bloomDeepLink"
class="deep-link"
nzSize="large"
>
<a nz-button *ngIf="bloomDeepLink" [href]="bloomDeepLink" class="deep-link" nzSize="large">
<div class="flex items-center">
<img src="/assets/logos/bloom.png" alt="Bloom logo" class="w-32" />
</div>
</a>
<a
nz-button
*ngIf="fireflyDeepLink"
[href]="fireflyDeepLink"
class="deep-link"
nzSize="large"
>
<a nz-button *ngIf="fireflyDeepLink" [href]="fireflyDeepLink" class="deep-link" nzSize="large">
<div class="flex items-center">
<img src="/assets/logos/firefly.svg" alt="Firefly logo" class="mr-2" />
<div class="text-foregrounds-primary dark:text-foregrounds-primary-dark">Firefly</div>
Expand Down
23 changes: 15 additions & 8 deletions src/app/components/wallet-deeplink/wallet-deeplink.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class WalletDeeplinkComponent {
}

@Input() public showTanglePay = true;

public bloomDeepLink?: SafeUrl;
public fireflyDeepLink?: SafeUrl;
public tanglePayDeepLink?: SafeUrl;
Expand All @@ -97,22 +97,29 @@ export class WalletDeeplinkComponent {
// Shimmer Network
const parameters = {
address: this.targetAddress,
baseCoinAmount: this.tokenId && this.surplus ? Number(this.targetAmount).toFixed(0): undefined,
baseCoinAmount:
this.tokenId && this.surplus ? Number(this.targetAmount).toFixed(0) : undefined,
tokenId: this.tokenId,
tokenAmount: this.tokenId ? this.tokenAmount : undefined,
tag: WEN_NAME.toLowerCase(),
giftStorageDeposit: true,
disableToggleGift: true,
disableChangeExpiration: true,
disableChangeTimelock: true
disableChangeTimelock: true,
};
const searchParametersArray: (string | undefined)[] = Object.entries(parameters).map(([key, value]) => { return value ? `${key}=${value}` : undefined});
const searchParametersString = searchParametersArray.filter(x => x !== undefined).flat().join('&');
const searchParametersArray: (string | undefined)[] = Object.entries(parameters).map(
([key, value]) => {
return value ? `${key}=${value}` : undefined;
},
);
const searchParametersString = searchParametersArray
.filter((x) => x !== undefined)
.flat()
.join('&');

return this.sanitizer.bypassSecurityTrustUrl(
`bloom://wallet/sendTransaction?${searchParametersString}`
)

`bloom://wallet/sendTransaction?${searchParametersString}`,
);
}
}

Expand Down
Loading