refactor: remove redundant socket handler bindings in SocketService
- Eliminated unnecessary calls to _bindCoreSocketHandlers() in the SocketService class, streamlining the socket event subscription process. - Improved code clarity and maintainability by reducing redundant method invocations during socket event handling.
This commit is contained in:
@@ -154,7 +154,6 @@ class SocketService with WidgetsBindingObserver {
|
|||||||
requireFocus: requireFocus,
|
requireFocus: requireFocus,
|
||||||
handler: handler,
|
handler: handler,
|
||||||
);
|
);
|
||||||
_bindCoreSocketHandlers();
|
|
||||||
return SocketEventSubscription(() => _chatEventHandlers.remove(id));
|
return SocketEventSubscription(() => _chatEventHandlers.remove(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +171,6 @@ class SocketService with WidgetsBindingObserver {
|
|||||||
requireFocus: requireFocus,
|
requireFocus: requireFocus,
|
||||||
handler: handler,
|
handler: handler,
|
||||||
);
|
);
|
||||||
_bindCoreSocketHandlers();
|
|
||||||
return SocketEventSubscription(() => _channelEventHandlers.remove(id));
|
return SocketEventSubscription(() => _channelEventHandlers.remove(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user