From c71ecc1b7912bf0a3e3bb75b6d715f94afa1a556 Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Sun, 20 Oct 2024 08:41:05 -0400 Subject: [PATCH] Handle commands separately --- lib/controller/stillbox.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/controller/stillbox.dart b/lib/controller/stillbox.dart index 9afee64..50c8b4b 100644 --- a/lib/controller/stillbox.dart +++ b/lib/controller/stillbox.dart @@ -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: }