1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 21:09:21 +00:00

Finish data conservation policy screen

This commit is contained in:
Pierre HUBERT 2021-02-16 19:35:52 +01:00
parent 3a39387365
commit 1d0bd45632

View File

@ -62,7 +62,7 @@ class _AccountPrivacySettingsState extends State<AccountPrivacySettings> {
List<SettingsTile> get _dataConservationPolicyTiles => [
DataConservationPolicyTile(
value: _userSettings.notificationLifetime,
title: tr("Automatically delete unread notification after"),
title: tr("Automatically delete unread notifications after"),
onChange: (val) {
_userSettings.notificationLifetime = val;
_updateDataConservationPolicy();
@ -70,6 +70,54 @@ class _AccountPrivacySettingsState extends State<AccountPrivacySettings> {
minValue:
_serverConfig.dataConservationPolicy.minNotificationLifetime,
),
DataConservationPolicyTile(
value: _userSettings.commentsLifetime,
title: tr("Automatically delete your comments after"),
onChange: (val) {
_userSettings.commentsLifetime = val;
_updateDataConservationPolicy();
},
minValue: _serverConfig.dataConservationPolicy.minCommentsLifetime,
),
DataConservationPolicyTile(
value: _userSettings.postsLifetime,
title: tr("Automatically delete your posts after"),
onChange: (val) {
_userSettings.postsLifetime = val;
_updateDataConservationPolicy();
},
minValue: _serverConfig.dataConservationPolicy.minPostsLifetime,
),
DataConservationPolicyTile(
value: _userSettings.conversationMessagesLifetime,
title: tr("Automatically delete your conversation messages after"),
onChange: (val) {
_userSettings.conversationMessagesLifetime = val;
_updateDataConservationPolicy();
},
minValue: _serverConfig
.dataConservationPolicy.minConversationMessagesLifetime,
),
DataConservationPolicyTile(
value: _userSettings.likesLifetime,
title: tr("Automatically delete your likes after"),
onChange: (val) {
_userSettings.likesLifetime = val;
_updateDataConservationPolicy();
},
minValue: _serverConfig.dataConservationPolicy.minLikesLifetime,
),
DataConservationPolicyTile(
value: _userSettings.inactiveAccountLifeTime,
title: tr(
"Automatically delete your account if you have been inactive for"),
onChange: (val) {
_userSettings.inactiveAccountLifeTime = val;
_updateDataConservationPolicy();
},
minValue:
_serverConfig.dataConservationPolicy.minInactiveAccountLifetime,
),
];
void _updateDataConservationPolicy() async {