mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-26 14:59:22 +00:00
Can update "allow posts from friends" setting
This commit is contained in:
parent
9e5decae61
commit
38c1474d2e
@ -11,7 +11,7 @@ class GeneralSettings {
|
|||||||
String lastName;
|
String lastName;
|
||||||
UserPageVisibility pageVisibility;
|
UserPageVisibility pageVisibility;
|
||||||
bool allowComments;
|
bool allowComments;
|
||||||
final bool allowPostsFromFriends;
|
bool allowPostsFromFriends;
|
||||||
bool allowComunicEmails;
|
bool allowComunicEmails;
|
||||||
final bool publicFriendsList;
|
final bool publicFriendsList;
|
||||||
final String virtualDirectory;
|
final String virtualDirectory;
|
||||||
|
@ -54,7 +54,9 @@ class __GeneralAccountSettingsBodyState
|
|||||||
onReload: () async =>
|
onReload: () async =>
|
||||||
_settings = await SettingsHelper.getGeneralSettings(),
|
_settings = await SettingsHelper.getGeneralSettings(),
|
||||||
onBuild: _buildSettings,
|
onBuild: _buildSettings,
|
||||||
errorMessage: tr("Could not load general settings!"));
|
errorMessage: tr("Could not load general settings!"),
|
||||||
|
showOldDataWhileUpdating: true,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildSettings() {
|
Widget _buildSettings() {
|
||||||
@ -166,6 +168,16 @@ class __GeneralAccountSettingsBodyState
|
|||||||
},
|
},
|
||||||
switchValue: _settings.allowComments,
|
switchValue: _settings.allowComments,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// Allow posts from friends
|
||||||
|
SettingsTile.switchTile(
|
||||||
|
title: tr("Allow posts from your friends on your page"),
|
||||||
|
onToggle: (v) {
|
||||||
|
_settings.allowPostsFromFriends = v;
|
||||||
|
_updateSettings();
|
||||||
|
},
|
||||||
|
switchValue: _settings.allowPostsFromFriends,
|
||||||
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,14 +25,19 @@ class AsyncScreenWidget extends StatefulWidget {
|
|||||||
/// Error message that will be shown in case of error
|
/// Error message that will be shown in case of error
|
||||||
final String errorMessage;
|
final String errorMessage;
|
||||||
|
|
||||||
|
/// Specify whether old data can be kept or not while updating this widget
|
||||||
|
final bool showOldDataWhileUpdating;
|
||||||
|
|
||||||
const AsyncScreenWidget({
|
const AsyncScreenWidget({
|
||||||
Key key,
|
Key key,
|
||||||
@required this.onReload,
|
@required this.onReload,
|
||||||
@required this.onBuild,
|
@required this.onBuild,
|
||||||
@required this.errorMessage,
|
@required this.errorMessage,
|
||||||
|
this.showOldDataWhileUpdating = false,
|
||||||
}) : assert(onReload != null),
|
}) : assert(onReload != null),
|
||||||
assert(onBuild != null),
|
assert(onBuild != null),
|
||||||
assert(errorMessage != null),
|
assert(errorMessage != null),
|
||||||
|
assert(showOldDataWhileUpdating != null),
|
||||||
super(key: key);
|
super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -75,7 +80,7 @@ class AsyncScreenWidgetState extends SafeState<AsyncScreenWidget> {
|
|||||||
try {
|
try {
|
||||||
setState(() {
|
setState(() {
|
||||||
error = false;
|
error = false;
|
||||||
ready = false;
|
ready = widget.showOldDataWhileUpdating;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Call parent method
|
// Call parent method
|
||||||
|
Loading…
Reference in New Issue
Block a user