Fix bugs
This commit is contained in:
@@ -104,7 +104,7 @@ class EnableAnalyticsPrefTile extends HookConsumerWidget {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final t = ref.watch(translationsProvider);
|
||||
|
||||
final autoReport = ref.watch(analyticsControllerProvider);
|
||||
final enabled = ref.watch(analyticsControllerProvider).requireValue;
|
||||
|
||||
return SwitchListTile(
|
||||
title: Text(t.settings.general.enableAnalytics),
|
||||
@@ -113,12 +113,12 @@ class EnableAnalyticsPrefTile extends HookConsumerWidget {
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
secondary: const Icon(Icons.bug_report),
|
||||
value: autoReport,
|
||||
value: enabled,
|
||||
onChanged: (value) async {
|
||||
if (onChanged != null) {
|
||||
return onChanged!(value);
|
||||
}
|
||||
if (autoReport) {
|
||||
if (enabled) {
|
||||
await ref
|
||||
.read(analyticsControllerProvider.notifier)
|
||||
.disableAnalytics();
|
||||
|
||||
@@ -73,7 +73,9 @@ class IntroPage extends HookConsumerWidget with PresLogger {
|
||||
onPressed: () async {
|
||||
if (isStarting.value) return;
|
||||
isStarting.value = true;
|
||||
if (!ref.read(analyticsControllerProvider)) {
|
||||
if (!ref
|
||||
.read(analyticsControllerProvider)
|
||||
.requireValue) {
|
||||
loggy.info("disabling analytics per user request");
|
||||
try {
|
||||
await ref
|
||||
|
||||
Reference in New Issue
Block a user