Skip to content

Commit

Permalink
update staking.maxNomination
Browse files Browse the repository at this point in the history
  • Loading branch information
RomeroYang committed Oct 25, 2021
1 parent 1d8590d commit b29631d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions lib/pages/staking/actions/nominateForm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class NominateForm extends StatefulWidget {
_NominateFormState createState() => _NominateFormState();
}

const MAX_NOMINATION = 16;

class _NominateFormState extends State<NominateForm> {
final List<ValidatorData> _selected = <ValidatorData>[];
final List<ValidatorData> _notSelected = <ValidatorData>[];
Expand All @@ -51,6 +49,8 @@ class _NominateFormState extends State<NominateForm> {
Widget _buildListItem(BuildContext context, ValidatorData validator) {
final dicStaking =
I18n.of(context)!.getDic(i18n_full_dic_kusama, 'staking')!;
final maxNomination = int.parse(
widget.plugin.networkConst['staking']['maxNominations'].toString());
final Map? accInfo =
widget.plugin.store!.accounts.addressIndexMap[validator.accountId];
final accIcon =
Expand Down Expand Up @@ -108,13 +108,14 @@ class _NominateFormState extends State<NominateForm> {
CupertinoSwitch(
value: _selectedMap[validator.accountId]!,
onChanged: (bool value) {
if (value && _selected.length >= MAX_NOMINATION) {
if (value && _selected.length >= maxNomination) {
showCupertinoDialog(
context: context,
builder: (_) {
return CupertinoAlertDialog(
title: Container(),
content: Text(dicStaking['nominate.max']!),
content: Text(
'${dicStaking['nominate.max']} $maxNomination'),
actions: [
CupertinoButton(
child: Text(I18n.of(context)!.getDic(
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/i18n/en/staking.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const Map<String, String> enStaking = {
'nominate.over': 'Oversubscribed',
'nominate.inactive': 'Inactive',
'nominate.waiting': 'Waiting',
'nominate.max': 'Max nomination number is 16.',
'nominate.max': 'Max nomination number is',
'phala': 'Phala Airdrop',
'recommend': 'Recommended',
};
2 changes: 1 addition & 1 deletion lib/utils/i18n/zh/staking.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const Map<String, String> zhStaking = {
'nominate.over': '超额认购',
'nominate.inactive': '不活跃',
'nominate.waiting': '等待',
'nominate.max': '提名数量最多 16 个',
'nominate.max': '最大提名数量',
'phala': 'Phala 空投',
'recommend': '推荐节点',
};

0 comments on commit b29631d

Please sign in to comment.