Add more haptic feedback

This commit is contained in:
problematicconsumer
2024-02-18 18:24:42 +03:30
parent c402a9e292
commit 4b8ea0f375
4 changed files with 25 additions and 0 deletions

View File

@@ -25,6 +25,17 @@ class ConnectionNotifier extends _$ConnectionNotifier with AppLogger {
}).run();
}
ref.listenSelf(
(previous, next) async {
if (previous == next) return;
if (previous case AsyncData(:final value) when !value.isConnected) {
if (next case AsyncData(value: final Connected _)) {
await ref.read(hapticServiceProvider.notifier).heavyImpact();
}
}
},
);
ref.listen(
activeProfileProvider.select((value) => value.asData?.value),
(previous, next) async {