feat: Enhance APNS token retrieval with retries and add cancel functionality to revert changes in notification and privacy settings.
This commit is contained in:
@@ -23,6 +23,14 @@ class _PrivacyTabState extends ConsumerState<PrivacyTab> {
|
||||
bool _isSavingPrivacy = false;
|
||||
bool _privacyLoaded = false;
|
||||
|
||||
// Snapshot for cancel/reset
|
||||
String _origProfileVisibility = 'public';
|
||||
String _origContactInfo = 'connections';
|
||||
String _origActivityStatus = 'public';
|
||||
bool _origShareAnalytics = false;
|
||||
bool _origPersonalizedAds = false;
|
||||
bool _origThirdPartySharing = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -50,6 +58,13 @@ class _PrivacyTabState extends ConsumerState<PrivacyTab> {
|
||||
dataSettings['thirdPartySharing'] as bool? ?? false;
|
||||
_isLoadingPrivacy = false;
|
||||
_privacyLoaded = true;
|
||||
// Save snapshot for cancel/reset
|
||||
_origProfileVisibility = _profileVisibility;
|
||||
_origContactInfo = _contactInfo;
|
||||
_origActivityStatus = _activityStatus;
|
||||
_origShareAnalytics = _shareAnalytics;
|
||||
_origPersonalizedAds = _personalizedAds;
|
||||
_origThirdPartySharing = _thirdPartySharing;
|
||||
});
|
||||
} catch (_) {
|
||||
setState(() => _isLoadingPrivacy = false);
|
||||
@@ -150,8 +165,14 @@ class _PrivacyTabState extends ConsumerState<PrivacyTab> {
|
||||
ProfileActionButtons(
|
||||
onSave: _savePrivacyPreferences,
|
||||
onCancel: () {
|
||||
_privacyLoaded = false;
|
||||
_loadPrivacyPreferences();
|
||||
setState(() {
|
||||
_profileVisibility = _origProfileVisibility;
|
||||
_contactInfo = _origContactInfo;
|
||||
_activityStatus = _origActivityStatus;
|
||||
_shareAnalytics = _origShareAnalytics;
|
||||
_personalizedAds = _origPersonalizedAds;
|
||||
_thirdPartySharing = _origThirdPartySharing;
|
||||
});
|
||||
},
|
||||
isSaving: _isSavingPrivacy),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
Reference in New Issue
Block a user