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:
cogwheel0
2025-10-06 00:15:51 +05:30
parent a2e5f46d62
commit c08bfa773d

View File

@@ -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));
} }