Skip to content

Commit

Permalink
use env
Browse files Browse the repository at this point in the history
Signed-off-by: phuoc <[email protected]>
  • Loading branch information
phuocbitmark committed Oct 24, 2023
1 parent c77e321 commit c28ba1a
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/android-release-appcenter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
echo TZKT_TESTNET_URL=${{ secrets.TZKT_TESTNET_URL }} >> .env
echo TZKT_MAINNET_URL=${{ secrets.TZKT_MAINNET_URL }} >> .env
${{ github.event.inputs.testnet == 'true' }} && echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_TESTNET }} >> .env || echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_MAINNET }} >> .env
${{ github.event.inputs.testnet == 'true' }} && echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_TESTNET }} >> .env || echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_MAINNET }} >> .env
echo FERAL_FILE_AUTHORIZATION_PREFIX=${{ secrets.FERAL_FILE_AUTHORIZATION_PREFIX }} >> .env
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bmvn_build_appcenter_android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ jobs:
echo TZKT_TESTNET_URL=${{ secrets.TZKT_TESTNET_URL }} >> .env
echo TZKT_MAINNET_URL=${{ secrets.TZKT_MAINNET_URL }} >> .env
${{ inputs.testnet == true }} && echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_TESTNET }} >> .env || echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_MAINNET }} >> .env
${{ inputs.testnet == true }} && echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_TESTNET }} >> .env || echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_MAINNET }} >> .env
echo FERAL_FILE_AUTHORIZATION_PREFIX=${{ secrets.FERAL_FILE_AUTHORIZATION_PREFIX }} >> .env
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bmvn_build_appcenter_ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ jobs:
echo TZKT_TESTNET_URL=${{ secrets.TZKT_TESTNET_URL }} >> .env
echo TZKT_MAINNET_URL=${{ secrets.TZKT_MAINNET_URL }} >> .env
${{ inputs.testnet == true }} && echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_TESTNET }} >> .env || echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_MAINNET }} >> .env
${{ inputs.testnet == true }} && echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_TESTNET }} >> .env || echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_MAINNET }} >> .env
echo FERAL_FILE_AUTHORIZATION_PREFIX=${{ secrets.FERAL_FILE_AUTHORIZATION_PREFIX }} >> .env
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ios-release-appstore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
echo TZKT_TESTNET_URL=${{ secrets.TZKT_TESTNET_URL }} >> .env
echo TZKT_MAINNET_URL=${{ secrets.TZKT_MAINNET_URL }} >> .env
${{ github.event.inputs.testnet == 'true' }} && echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_TESTNET }} >> .env || echo POSTCARD_CONTRACT_ADDRESS=${{ secrets.POSTCARD_CONTRACT_ADDRESS_MAINNET }} >> .env
${{ github.event.inputs.testnet == 'true' }} && echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_TESTNET }} >> .env || echo AUTONOMY_MERCHANDISE_BASE_URL=${{ secrets.AUTONOMY_MERCHANDISE_BASE_URL_MAINNET }} >> .env
echo FERAL_FILE_AUTHORIZATION_PREFIX=${{ secrets.FERAL_FILE_AUTHORIZATION_PREFIX }} >> .env
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env
Expand Down
2 changes: 1 addition & 1 deletion assets
3 changes: 3 additions & 0 deletions lib/common/environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ class Environment {
static String get postcardContractAddress =>
dotenv.env['POSTCARD_CONTRACT_ADDRESS'] ?? '';

static String get merchandiseBaseUrl =>
dotenv.env['AUTONOMY_MERCHANDISE_BASE_URL'] ?? '';

static String get chatServerHmacKey =>
dotenv.env['CHAT_SERVER_HMAC_KEY'] ?? '';

Expand Down
3 changes: 2 additions & 1 deletion lib/screen/interactive_postcard/postcard_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'dart:collection';
import 'dart:convert';

import 'package:after_layout/after_layout.dart';
import 'package:autonomy_flutter/common/environment.dart';
import 'package:autonomy_flutter/common/injector.dart';
import 'package:autonomy_flutter/model/pair.dart';
import 'package:autonomy_flutter/model/play_control_model.dart';
Expand Down Expand Up @@ -688,7 +689,7 @@ class ClaimedPostcardDetailPageState extends State<ClaimedPostcardDetailPage>
log.info("?indexId=$indexId&hasCS=$hasCustomerSupport");
if (!context.mounted) return;
final url =
"$AUTONOMY_MERCHANDISE_BASE_URL/?indexId=$indexId&hasCS=${hasCustomerSupport.toString()}&token=$jwtToken";
"${Environment.merchandiseBaseUrl}?indexId=$indexId&hasCS=$hasCustomerSupport&token=$jwtToken";
Navigator.of(context).pushNamed(AppRouter.irlWebView,
arguments: IRLWebScreenPayload(url, isPlainUI: true));
},
Expand Down
2 changes: 0 additions & 2 deletions lib/util/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ const DEEP_LINKS = [
const FF_ARTIST_COLLECTOR =
'https://feralfile.com/docs/artist-collector-rights';
const WEB3_PRIMER_URL = 'https://autonomy.io/catalog/primer/';
const AUTONOMY_MERCHANDISE_BASE_URL =
"http://192.168.31.162:3000"; //'https://autonomy.io/merchandise/';

const POSTCARD_RIGHTS_DOCS =
"https://raw.githubusercontent.com/bitmark-inc/autonomy-apps/main/docs/postcard_collector_rights.md";
Expand Down

0 comments on commit c28ba1a

Please sign in to comment.