implemented a comprehensive client-side demo mode triggered by a "demo@" username prefix, serving curated fixture data for all app modules
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:nextcloud/notifications.dart' show generatePushTokenHash;
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
import '../api/demo/demo_mode.dart';
|
||||
import '../api/marianumcloud/app_password/delete_app_password.dart';
|
||||
import '../api/marianumcloud/app_password/get_app_password.dart';
|
||||
import '../api/marianumconnect/marianumconnect_endpoint.dart';
|
||||
@@ -93,6 +94,7 @@ class PushRegistration {
|
||||
/// transport failures are logged and swallowed so callers can
|
||||
/// fire-and-forget (and simply ignore the result).
|
||||
Future<bool> register() async {
|
||||
if (DemoMode.active) return false;
|
||||
final String? fcmToken;
|
||||
try {
|
||||
fcmToken = await FirebaseMessaging.instance.getToken();
|
||||
@@ -383,6 +385,7 @@ class PushRegistration {
|
||||
/// is called with), then clear them locally. Ordered so the proxy stops
|
||||
/// pushing before credentials are gone.
|
||||
Future<void> logoutCleanup() async {
|
||||
if (DemoMode.active) return;
|
||||
await unregister();
|
||||
try {
|
||||
await DeleteAppPassword().run();
|
||||
|
||||
Reference in New Issue
Block a user