From 00db3d96e6cfbe0cae53794b4c09ba46ea4597ed Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 26 May 2026 19:57:11 +0200 Subject: [PATCH] Properly online-gate access to the user profile --- lib/widgets/core/app_bar.dart | 7 +++++++ lib/widgets/core/core.dart | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/widgets/core/app_bar.dart b/lib/widgets/core/app_bar.dart index 2c988d55c..11021828b 100644 --- a/lib/widgets/core/app_bar.dart +++ b/lib/widgets/core/app_bar.dart @@ -22,6 +22,7 @@ import 'package:wger/database/powersync/powersync.dart' show syncStatus; import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/providers/account_notifier.dart'; import 'package:wger/providers/auth_notifier.dart'; +import 'package:wger/providers/network_provider.dart'; import 'package:wger/screens/form_screen.dart'; import 'package:wger/screens/settings_dashboard_widgets_screen.dart'; import 'package:wger/widgets/core/about.dart'; @@ -79,6 +80,8 @@ class MainSettingsDialog extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { + final isOnline = ref.watch(networkStatusProvider); + return AlertDialog( title: Text(AppLocalizations.of(context).optionsLabel), actions: [ @@ -97,6 +100,10 @@ class MainSettingsDialog extends ConsumerWidget { //dense: true, leading: const Icon(Icons.person), title: Text(AppLocalizations.of(context).userProfile), + enabled: isOnline, + trailing: isOnline + ? null + : Icon(Icons.cloud_off, color: Theme.of(context).colorScheme.outline), onTap: () { Navigator.pushNamed( context, diff --git a/lib/widgets/core/core.dart b/lib/widgets/core/core.dart index 12a545537..5a45407e1 100644 --- a/lib/widgets/core/core.dart +++ b/lib/widgets/core/core.dart @@ -1,13 +1,13 @@ /* * This file is part of wger Workout Manager . - * Copyright (C) 2020, 2021 wger Team + * Copyright (c) 2020 - 2026 wger Team * * wger Workout Manager is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * wger Workout Manager is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details.