Compare commits

..
2 changed files with 2 additions and 25 deletions

View file

@ -68,8 +68,6 @@ class NotificationController
);
}
});
ref.onDispose(() => notificationChannel.setMethodCallHandler(null));
}
return notifications;

View file

@ -1,4 +1,3 @@
import "dart:async";
import "dart:convert";
import "dart:io";
@ -79,30 +78,10 @@ class UnifiedPushController extends AsyncNotifier<bool> {
return;
}
final provider = RoomsController.provider.select(
(rooms) => rooms[event.roomId],
final room = ref.read(
RoomsController.provider.select((rooms) => rooms[event.roomId]),
);
if (ref.read(provider)?.metadata != null) return;
final completer = Completer<void>();
final subscription = ref.listen(provider, (previous, next) {
if (next?.metadata != null && !completer.isCompleted) {
completer.complete();
}
});
try {
await completer.future.timeout(const .new(seconds: 10));
} on TimeoutException {
// metadata didn't show up in time
} finally {
subscription.close();
}
final room = ref.read(provider);
final avatar = room?.metadata?.avatar;
final icon = avatar == null
? null