From 1d0bd456322c2ffc4fe91911000931fdaa180c83 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Tue, 16 Feb 2021 19:35:52 +0100 Subject: [PATCH] Finish data conservation policy screen --- .../settings/account_privacy_settings.dart | 50 ++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/lib/ui/routes/settings/account_privacy_settings.dart b/lib/ui/routes/settings/account_privacy_settings.dart index e45ce00..e76277c 100644 --- a/lib/ui/routes/settings/account_privacy_settings.dart +++ b/lib/ui/routes/settings/account_privacy_settings.dart @@ -62,7 +62,7 @@ class _AccountPrivacySettingsState extends State { List 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 { 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 {