forked from firka/firka
chore: dart format + remove unused imports
This commit is contained in:
@@ -332,13 +332,18 @@ class KretaClient {
|
||||
|
||||
if (_tokenMutexCompleter != null) {
|
||||
try {
|
||||
await _tokenMutexCompleter!.future.timeout(maxWaitTime, onTimeout: () {
|
||||
logger.warning(
|
||||
"[Mutex] Timeout waiting for token mutex, forcing release");
|
||||
if (_tokenMutexCompleter != null && !_tokenMutexCompleter!.isCompleted) {
|
||||
_tokenMutexCompleter!.complete();
|
||||
}
|
||||
});
|
||||
await _tokenMutexCompleter!.future.timeout(
|
||||
maxWaitTime,
|
||||
onTimeout: () {
|
||||
logger.warning(
|
||||
"[Mutex] Timeout waiting for token mutex, forcing release",
|
||||
);
|
||||
if (_tokenMutexCompleter != null &&
|
||||
!_tokenMutexCompleter!.isCompleted) {
|
||||
_tokenMutexCompleter!.complete();
|
||||
}
|
||||
},
|
||||
);
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -863,7 +863,6 @@ class LiveActivityService {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
final liveActivityEnabled = await isEnabled(settingsStore, client);
|
||||
final morningNotificationEnabled =
|
||||
_getCurrentMorningNotificationEnabled() ?? false;
|
||||
|
||||
@@ -489,7 +489,9 @@ class WatchSyncHelper {
|
||||
} else if (arguments is Map) {
|
||||
message = Map<String, dynamic>.from(arguments);
|
||||
} else {
|
||||
debugPrint('[WatchSync] onWatchMessage: unexpected type ${arguments.runtimeType}');
|
||||
debugPrint(
|
||||
'[WatchSync] onWatchMessage: unexpected type ${arguments.runtimeType}',
|
||||
);
|
||||
return;
|
||||
}
|
||||
debugPrint('[WatchSync] Received Watch message: ${message["id"]}');
|
||||
|
||||
@@ -7,7 +7,6 @@ import 'package:firka/helpers/db/models/app_settings_model.dart';
|
||||
import 'package:firka/helpers/db/models/generic_cache_model.dart';
|
||||
import 'package:firka/helpers/db/models/timetable_cache_model.dart';
|
||||
import 'package:firka/helpers/db/models/token_model.dart';
|
||||
import 'package:firka/helpers/extensions.dart';
|
||||
import 'package:firka/helpers/firka_bundle.dart';
|
||||
import 'package:firka/helpers/settings.dart';
|
||||
import 'package:firka/helpers/swear_generator.dart';
|
||||
@@ -576,7 +575,9 @@ class InitializationScreen extends StatelessWidget {
|
||||
if (initData.tokens.isNotEmpty) {
|
||||
logger.finest("WatchOS IPC [Phone -> Watch]: pong");
|
||||
const watchChannel = MethodChannel('app.firka/watch_sync');
|
||||
watchChannel.invokeMethod('sendMessageToWatch', {"id": "pong"});
|
||||
watchChannel.invokeMethod('sendMessageToWatch', {
|
||||
"id": "pong",
|
||||
});
|
||||
navigatorKey.currentState?.push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => HomeScreen(
|
||||
|
||||
@@ -277,7 +277,9 @@ class _HomeScreenState extends FirkaState<HomeScreen>
|
||||
|
||||
final lifecycle = WidgetsBinding.instance.lifecycleState;
|
||||
if (lifecycle != null && lifecycle != AppLifecycleState.resumed) {
|
||||
logger.info('[Home] prefetch: App is in background, deferring to foreground');
|
||||
logger.info(
|
||||
'[Home] prefetch: App is in background, deferring to foreground',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -511,7 +513,9 @@ class _HomeScreenState extends FirkaState<HomeScreen>
|
||||
|
||||
widget.data.settingsUpdateNotifier.addListener(settingsUpdateListener);
|
||||
|
||||
widget.data.profilePictureUpdateNotifier.addListener(_onProfilePictureUpdated);
|
||||
widget.data.profilePictureUpdateNotifier.addListener(
|
||||
_onProfilePictureUpdated,
|
||||
);
|
||||
|
||||
// Listen for reauth state changes (e.g., when Watch sends a valid token)
|
||||
KretaClient.reauthStateNotifier.addListener(_onReauthStateChanged);
|
||||
@@ -622,11 +626,7 @@ class _HomeScreenState extends FirkaState<HomeScreen>
|
||||
|
||||
if (widget.watchPair && !pairingDone) {
|
||||
Timer.run(() {
|
||||
showWearBottomSheet(
|
||||
context,
|
||||
widget.data,
|
||||
widget.model ?? "unknown",
|
||||
);
|
||||
showWearBottomSheet(context, widget.data, widget.model ?? "unknown");
|
||||
|
||||
// pairingDone = true;
|
||||
});
|
||||
@@ -936,7 +936,9 @@ class _HomeScreenState extends FirkaState<HomeScreen>
|
||||
|
||||
void _refreshLiveActivityOnResume() async {
|
||||
if (!_hasCompletedFirstPrefetch) {
|
||||
logger.info('[Home] Skipping LiveActivity update: first prefetch not yet complete');
|
||||
logger.info(
|
||||
'[Home] Skipping LiveActivity update: first prefetch not yet complete',
|
||||
);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -951,7 +953,9 @@ class _HomeScreenState extends FirkaState<HomeScreen>
|
||||
settingsStore: widget.data.settings,
|
||||
);
|
||||
} catch (e) {
|
||||
logger.warning('[Home] LiveActivity timetable update on resume failed: $e');
|
||||
logger.warning(
|
||||
'[Home] LiveActivity timetable update on resume failed: $e',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -960,8 +964,9 @@ class _HomeScreenState extends FirkaState<HomeScreen>
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
_pageController.dispose();
|
||||
widget.data.settingsUpdateNotifier.removeListener(settingsUpdateListener);
|
||||
widget.data.profilePictureUpdateNotifier
|
||||
.removeListener(_onProfilePictureUpdated);
|
||||
widget.data.profilePictureUpdateNotifier.removeListener(
|
||||
_onProfilePictureUpdated,
|
||||
);
|
||||
|
||||
// Remove reauth state listener
|
||||
KretaClient.reauthStateNotifier.removeListener(_onReauthStateChanged);
|
||||
|
||||
Reference in New Issue
Block a user