@@ -1132,31 +1132,35 @@ class _FeedDecoratorFormState extends State<_FeedDecoratorForm> {
1132
1132
CheckboxListTile (
1133
1133
title: Text (role.l10n (context)),
1134
1134
value: roleConfig != null ,
1135
- onChanged: (value) {
1136
- final newVisibleTo =
1137
- Map <AppUserRole , FeedDecoratorRoleConfig >.from (
1138
- decoratorConfig.visibleTo,
1139
- );
1140
- if (value == true ) {
1141
- newVisibleTo[role] = const FeedDecoratorRoleConfig (
1142
- daysBetweenViews: 7 ,
1143
- );
1144
- } else {
1145
- newVisibleTo.remove (role);
1146
- }
1147
- final newDecoratorConfig = decoratorConfig.copyWith (
1148
- visibleTo: newVisibleTo,
1149
- );
1150
- final newFeedDecoratorConfig =
1151
- Map <FeedDecoratorType , FeedDecoratorConfig >.from (
1152
- widget.remoteConfig.feedDecoratorConfig,
1153
- )..[widget.decoratorType] = newDecoratorConfig;
1154
- widget.onConfigChanged (
1155
- widget.remoteConfig.copyWith (
1156
- feedDecoratorConfig: newFeedDecoratorConfig,
1157
- ),
1158
- );
1159
- },
1135
+ onChanged: widget.decoratorType == FeedDecoratorType .linkAccount &&
1136
+ (role == AppUserRole .standardUser ||
1137
+ role == AppUserRole .premiumUser)
1138
+ ? null // Disable for standard and premium users for linkAccount
1139
+ : (value) {
1140
+ final newVisibleTo =
1141
+ Map <AppUserRole , FeedDecoratorRoleConfig >.from (
1142
+ decoratorConfig.visibleTo,
1143
+ );
1144
+ if (value == true ) {
1145
+ newVisibleTo[role] = const FeedDecoratorRoleConfig (
1146
+ daysBetweenViews: 7 ,
1147
+ );
1148
+ } else {
1149
+ newVisibleTo.remove (role);
1150
+ }
1151
+ final newDecoratorConfig = decoratorConfig.copyWith (
1152
+ visibleTo: newVisibleTo,
1153
+ );
1154
+ final newFeedDecoratorConfig =
1155
+ Map <FeedDecoratorType , FeedDecoratorConfig >.from (
1156
+ widget.remoteConfig.feedDecoratorConfig,
1157
+ )..[widget.decoratorType] = newDecoratorConfig;
1158
+ widget.onConfigChanged (
1159
+ widget.remoteConfig.copyWith (
1160
+ feedDecoratorConfig: newFeedDecoratorConfig,
1161
+ ),
1162
+ );
1163
+ },
1160
1164
),
1161
1165
if (roleConfig != null )
1162
1166
Padding (
0 commit comments