Handle commands separately

This commit is contained in:
Daniel Ponte 2024-10-20 08:41:05 -04:00
parent 6edbf3ac39
commit c71ecc1b79

View file

@ -134,7 +134,14 @@ class Stillbox extends ChangeNotifier {
case Message_ToClientMessage.hello:
version = msg.hello.version;
case Message_ToClientMessage.response:
final response = msg.response;
_handleCommandResponse(msg.response);
default:
}
}
void _handleCommandResponse(CommandResponse response) {
switch (response.whichCommandResponse()) {
case CommandResponse_CommandResponse.tgInfo:
tgCache.handleTgInfo(response.tgInfo);
default:
}