chore(llc): remove redundant event.me listener
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -318,9 +318,7 @@ class StreamChatClient {
|
|||||||
final ownUser = OwnUser.fromUser(user);
|
final ownUser = OwnUser.fromUser(user);
|
||||||
state.currentUser = ownUser;
|
state.currentUser = ownUser;
|
||||||
|
|
||||||
if (!connectWebSocket) {
|
if (!connectWebSocket) return ownUser;
|
||||||
return ownUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (_originalChatPersistenceClient != null) {
|
if (_originalChatPersistenceClient != null) {
|
||||||
@@ -1336,21 +1334,6 @@ class ClientState {
|
|||||||
/// Creates a new instance listening to events and updating the state
|
/// Creates a new instance listening to events and updating the state
|
||||||
ClientState(this._client) {
|
ClientState(this._client) {
|
||||||
_subscriptions.addAll([
|
_subscriptions.addAll([
|
||||||
_client
|
|
||||||
.on()
|
|
||||||
.where((event) =>
|
|
||||||
event.me != null && event.type != EventType.healthCheck)
|
|
||||||
.map((e) => e.me!)
|
|
||||||
.listen((user) {
|
|
||||||
currentUser = user;
|
|
||||||
final totalUnreadCount = user.totalUnreadCount;
|
|
||||||
_totalUnreadCountController.add(totalUnreadCount);
|
|
||||||
|
|
||||||
final unreadChannels = user.unreadChannels;
|
|
||||||
if (unreadChannels != null) {
|
|
||||||
_unreadChannelsController.add(unreadChannels);
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
_client
|
_client
|
||||||
.on()
|
.on()
|
||||||
.map((event) => event.unreadChannels)
|
.map((event) => event.unreadChannels)
|
||||||
@@ -1413,7 +1396,8 @@ class ClientState {
|
|||||||
|
|
||||||
final StreamChatClient _client;
|
final StreamChatClient _client;
|
||||||
|
|
||||||
/// Update user information
|
/// Sets the user currently interacting with the client
|
||||||
|
/// note: this fully overrides the [currentUser]
|
||||||
set currentUser(OwnUser? user) {
|
set currentUser(OwnUser? user) {
|
||||||
_currentUserController.add(user);
|
_currentUserController.add(user);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user