Skip to content

Commit

Permalink
update logics
Browse files Browse the repository at this point in the history
  • Loading branch information
kidozh committed Aug 17, 2024
1 parent 69cf448 commit a7fcfca
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/page/ChooseAdExemptPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,20 @@ class _ChooseAdExemptState extends State<ChooseAdExemptPage> {
title: Text(discuz.siteName),
trailing: _adExemptHost == discuz.host? Icon(AppPlatformIcons(context).check): null,
onPressed: (context){
VibrationUtils.vibrateWithClickIfPossible();
String adExemptHost = "";
if(_adExemptHost == discuz.host){
adExemptHost = "";
}
else{
adExemptHost = discuz.host;
}
setState(() {
VibrationUtils.vibrateWithClickIfPossible();
_adExemptHost = discuz.host;
_adExemptHost = adExemptHost;
log("Set advertisement ${_adExemptHost}");
});
UserPreferencesUtils.putAdExemptDiscuzHostPreference(discuz.host);
Provider.of<UserPreferenceNotifierProvider>(context,listen: false).adExemptHost = discuz.host;
UserPreferencesUtils.putAdExemptDiscuzHostPreference(adExemptHost);
Provider.of<UserPreferenceNotifierProvider>(context,listen: false).adExemptHost = adExemptHost;
},
)
).toList()
Expand Down

0 comments on commit a7fcfca

Please sign in to comment.