Skip to content

Commit

Permalink
Merge pull request #82 from soonaverse/file_upload
Browse files Browse the repository at this point in the history
Set projectapikey with file upload
  • Loading branch information
adamunchained authored Nov 8, 2023
2 parents f9fd207 + cfe9c8f commit cc18578
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
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,6 +47,7 @@ export class FileApi {
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)
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

0 comments on commit cc18578

Please sign in to comment.