added warning to google calendar sync
This commit is contained in:
parent
afb9e5ee2c
commit
c10c17f72f
@ -34,14 +34,44 @@ class MenuCalendarSync extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return PanelButton(
|
return PanelButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (!Provider.of<PlusProvider>(context, listen: false)
|
showDialog(
|
||||||
.hasScope(PremiumScopes.calendarSync)) {
|
context: context,
|
||||||
return PlusLockedFeaturePopup.show(
|
builder: (context) => AlertDialog(
|
||||||
context: context, feature: PremiumFeature.calendarSync);
|
title: const Text("Figyelem!"),
|
||||||
}
|
content: const Text(
|
||||||
|
"A naptár szinkronizálás csak azután fog működni, hogy a Google elfogadja az OAuth kérelmünket, addig is szíves türelmeteket kérjük! Amint ez megtörténik, értesíteni fogunk titeket Discord-on, valamint alkalmazáson belüli hírekben is."),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
child: const Text(
|
||||||
|
"Vissza",
|
||||||
|
style: TextStyle(fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
child: const Text(
|
||||||
|
"Tovább",
|
||||||
|
style: TextStyle(fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
|
||||||
Navigator.of(context, rootNavigator: true).push(CupertinoPageRoute(
|
if (!Provider.of<PlusProvider>(context, listen: false)
|
||||||
builder: (context) => const CalendarSyncScreen()));
|
.hasScope(PremiumScopes.calendarSync)) {
|
||||||
|
return PlusLockedFeaturePopup.show(
|
||||||
|
context: context, feature: PremiumFeature.calendarSync);
|
||||||
|
}
|
||||||
|
|
||||||
|
Navigator.of(context, rootNavigator: true).push(
|
||||||
|
CupertinoPageRoute(
|
||||||
|
builder: (context) => const CalendarSyncScreen()));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
title: Text(
|
title: Text(
|
||||||
"calendar_sync".i18n,
|
"calendar_sync".i18n,
|
||||||
|
@ -29,13 +29,6 @@ class WelcomeMessagePanelButton extends StatelessWidget {
|
|||||||
|
|
||||||
return PanelButton(
|
return PanelButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (!Provider.of<PlusProvider>(context, listen: false)
|
|
||||||
.hasScope(PremiumScopes.welcomeMessage)) {
|
|
||||||
PlusLockedFeaturePopup.show(
|
|
||||||
context: context, feature: PremiumFeature.welcomeMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => WelcomeMessageEditor(settingsProvider));
|
builder: (context) => WelcomeMessageEditor(settingsProvider));
|
||||||
@ -145,6 +138,14 @@ class _WelcomeMessageEditorState extends State<WelcomeMessageEditor> {
|
|||||||
.replaceFirst('\$s', '%s');
|
.replaceFirst('\$s', '%s');
|
||||||
// .replaceAll('\$s', 's');
|
// .replaceAll('\$s', 's');
|
||||||
|
|
||||||
|
if (!Provider.of<PlusProvider>(context, listen: false)
|
||||||
|
.hasScope(PremiumScopes.welcomeMessage) &&
|
||||||
|
finalText.replaceAll(' ', '') != '') {
|
||||||
|
PlusLockedFeaturePopup.show(
|
||||||
|
context: context, feature: PremiumFeature.welcomeMessage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
widget.settingsProvider
|
widget.settingsProvider
|
||||||
.update(welcomeMessage: finalText, store: true);
|
.update(welcomeMessage: finalText, store: true);
|
||||||
Navigator.of(context).pop(true);
|
Navigator.of(context).pop(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user