@@ -92,7 +92,7 @@ class _ProposePageState extends State<ProposePage> {
92
92
93
93
@override
94
94
Widget build (BuildContext context) {
95
- // final store = context.read<AppStore>();
95
+ final store = context.read <AppStore >();
96
96
final l10n = context.l10n;
97
97
98
98
return Scaffold (
@@ -158,12 +158,16 @@ class _ProposePageState extends State<ProposePage> {
158
158
159
159
// Submit Button
160
160
const Spacer (),
161
+ if (! isBootstrapperOrReputable (store, store.account.currentAddress))
162
+ Text (l10n.proposalOnlyBootstrappersOrReputablesCanSubmit, textAlign: TextAlign .center),
161
163
SubmitButton (
162
- onPressed: (context) async {
163
- _formKey.currentState! .validate ();
164
- await _submitProposal ();
165
- Navigator .of (context).pop ();
166
- },
164
+ onPressed: isBootstrapperOrReputable (store, store.account.currentAddress)
165
+ ? (context) async {
166
+ _formKey.currentState! .validate ();
167
+ await _submitProposal ();
168
+ Navigator .of (context).pop ();
169
+ }
170
+ : null , // disable button for non-bootstrappers/reputables
167
171
child: Text (l10n.proposalSubmit),
168
172
),
169
173
],
@@ -506,6 +510,11 @@ class _ProposePageState extends State<ProposePage> {
506
510
}
507
511
}
508
512
513
+ bool isBootstrapperOrReputable (AppStore store, String address) {
514
+ return store.encointer.community! .bootstrappers! .contains (address) ||
515
+ store.encointer.accountStores! [address]! .verifiedReputations.isNotEmpty;
516
+ }
517
+
509
518
/// Validates Inactivity Timeout (Only positive integers)
510
519
String ? validateInactivityTimeout (String ? value) {
511
520
final l10n = context.l10n;
0 commit comments