Compare commits
2 changed files with 2 additions and 25 deletions
|
|
@ -68,8 +68,6 @@ class NotificationController
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ref.onDispose(() => notificationChannel.setMethodCallHandler(null));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return notifications;
|
return notifications;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import "dart:async";
|
|
||||||
import "dart:convert";
|
import "dart:convert";
|
||||||
import "dart:io";
|
import "dart:io";
|
||||||
|
|
||||||
|
|
@ -79,30 +78,10 @@ class UnifiedPushController extends AsyncNotifier<bool> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final provider = RoomsController.provider.select(
|
final room = ref.read(
|
||||||
(rooms) => rooms[event.roomId],
|
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 avatar = room?.metadata?.avatar;
|
||||||
final icon = avatar == null
|
final icon = avatar == null
|
||||||
? null
|
? null
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue