Skip to content

Commit

Permalink
Merge pull request #1656 from numbersprotocol/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
sultanmyrza committed Jun 1, 2022
2 parents fb0a44a + 771ee2a commit 25f7383
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.58.0 - 2022-05-31

## Changed

- Update authmedia link to use one-time token for private assets

## 0.57.3 - 2022-05-27

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "io.numbersprotocol.capturelite"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 396
versionName "0.57.3"
versionCode 340
versionName "0.58.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "capture-lite",
"version": "0.57.3",
"version": "0.58.0",
"author": "numbersprotocol",
"homepage": "https://numbersprotocol.io/",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/home/details/details.page.ts
Expand Up @@ -302,7 +302,7 @@ export class DetailsPage {
const result = await this.confirmAlert.present({
message:
this.translocoService.translate(
'message.assetBecomePublicAfterSharing'
'message.assetBecomePublicFor24Hours'
) + '!',
});
if (result) {
Expand Down
11 changes: 9 additions & 2 deletions src/app/shared/share/share.service.ts
Expand Up @@ -2,7 +2,10 @@ import { Injectable } from '@angular/core';
import { Share } from '@capacitor/share';
import { TranslocoService } from '@ngneat/transloco';
import { catchError } from 'rxjs/operators';
import { getAssetProfileUrl } from '../../utils/url';
import {
getAssetProfileUrl,
getAssetProfileUrlWithTmpToken,
} from '../../utils/url';
import {
DiaBackendAsset,
DiaBackendAssetRepository,
Expand All @@ -22,9 +25,13 @@ export class ShareService {
) {}

async share(asset: DiaBackendAsset) {
const tmpToken = await this.diaBackendAssetRepository
.createTemporaryShareToken$(asset.id)
.toPromise();

return Share.share({
text: this.defaultShareText,
url: await this.setPublicAndGetLink(asset),
url: getAssetProfileUrlWithTmpToken(asset.id, tmpToken),
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/utils/url.ts
Expand Up @@ -13,7 +13,7 @@ export function getAssetProfileUrl(id: string, token?: string) {

export function getAssetProfileUrlWithTmpToken(id: string, tmpToken?: string) {
if (tmpToken) {
return `https://authmedia.net/asset-profile?cid=${id}&tmp_token=${tmpToken}`;
return `https://authmedia.net/asset-profile?cid=${id}&token=${tmpToken}`;
}
return `https://authmedia.net/asset-profile?cid=${id}`;
}
1 change: 1 addition & 0 deletions src/assets/i18n/en-us.json
Expand Up @@ -183,6 +183,7 @@
"copyIpfsAddress": "Copy IPFS address",
"shareAssetProfile": "Share Asset Profile",
"assetBecomePublicAfterSharing": "This asset will become public after sharing",
"assetBecomePublicFor24Hours": "Anyone with the link will be able to access the asset in the next 24 hours",
"mintNftToken": "Mint NFT token",
"mintNftAlert": "Once the NFT is minted, photo and its information can be accessed publicly. Do you still want to proceed?",
"sentSuccessfully": "Sent Successfully",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/zh-tw.json
Expand Up @@ -183,6 +183,7 @@
"copyIpfsAddress": "複製 IPFS 位址",
"shareAssetProfile": "分享資產檔案",
"assetBecomePublicAfterSharing": "該資產將在分享後公開",
"assetBecomePublicFor24Hours": "其他用戶在接下來的 24 小時將可透過此連結存取影像",
"mintNftToken": "鑄造 NFT 代幣",
"mintNftAlert": "NFT 代幣鑄造後,影像以及所有資訊都將可被公開檢視。確定要繼續嗎?",
"sentSuccessfully": "成功送出",
Expand Down

0 comments on commit 25f7383

Please sign in to comment.