show cm after receiving textchat when cm hidden

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-06-20 12:43:38 +08:00
parent 2e5eb86c97
commit 79fc51a1b5
3 changed files with 44 additions and 21 deletions

View File

@@ -13,6 +13,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import '../consts.dart';
import '../common.dart';
import '../common/widgets/overlay.dart';
import '../main.dart';
import 'model.dart';
class MessageBody {
@@ -288,6 +289,10 @@ class ChatModel with ChangeNotifier {
return;
}
if (text.isEmpty) return;
if (desktopType == DesktopType.cm) {
await showCmWindow();
}
// mobile: first message show overlay icon
if (!isDesktop && chatIconOverlayEntry == null) {
showChatIconOverlay();

View File

@@ -224,9 +224,9 @@ class ServerModel with ChangeNotifier {
_hideCm = hideCm;
if (desktopType == DesktopType.cm) {
if (hideCm) {
hideCmWindow();
await hideCmWindow();
} else {
showCmWindow();
await showCmWindow();
}
}
update = true;