Skip to content

Commit

Permalink
HOTFIX: SetMetadata button is enabled only for asset owner
Browse files Browse the repository at this point in the history
  • Loading branch information
L3odr0id committed Apr 29, 2024
1 parent b55ec24 commit d984f0e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:auto_route/auto_route.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
import 'package:threedpass/core/widgets/buttons/elevated_button.dart';
import 'package:threedpass/core/widgets/other/fast_rich_text.dart';
import 'package:threedpass/core/widgets/paddings.dart';
Expand Down Expand Up @@ -28,18 +30,26 @@ class PoscanAssetMetadataSection extends StatelessWidget {
@override
Widget build(final BuildContext context) {
if (metadata == null) {
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const D3pBodyMediumText('poscan_asset_page_metadata_help'),
const SizedBoxH8(),
D3pElevatedButton(
text: 'poscan_asset_page_metadata_button_label'.tr(),
onPressed: () => onPressed(context),
),
],
);
final account = BlocProvider.of<AppServiceLoaderCubit>(context)
.state
.keyring
.current; // TODO Change this for read-only mode
if (poscanAssetData.owner == account.address) {
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const D3pBodyMediumText('poscan_asset_page_metadata_help'),
const SizedBoxH8(),
D3pElevatedButton(
text: 'poscan_asset_page_metadata_button_label'.tr(),
onPressed: () => onPressed(context),
),
],
);
} else {
return D3pBodyMediumText('No metadata set for this asset');
}
} else {
final children = [
FastRichText(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ publish_to: 'none'
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 2.14.0+36
version: 2.14.1+37

environment:
sdk: ">=3.0.6 <3.0.7"
Expand Down

0 comments on commit d984f0e

Please sign in to comment.