Browse Source

[new]优化谈话数据同步问题

zk 1 year ago
parent
commit
d02ffe6dda
2 changed files with 2 additions and 6 deletions
  1. 2 1
      lib/module/talk/controller.dart
  2. 0 5
      lib/module/talk/mindmap/controller.dart

+ 2 - 1
lib/module/talk/controller.dart

@@ -888,7 +888,8 @@ class TalkController extends BaseController {
         .timeout(const Duration(seconds: 30))
         .then((data) {
       LoadingDialog.hide();
-      talkBean.value = data;
+      talkBean.value?.updateBean(data);
+      templateSelectId.value = templateId;
       ToastUtil.showToast('生成成功', displayType: SmartToastType.last);
     }).catchError((error) {
       LoadingDialog.hide();

+ 0 - 5
lib/module/talk/mindmap/controller.dart

@@ -27,7 +27,6 @@ class MindMapController extends BaseController {
 
   StreamSubscription? _talkSummaryListener;
   StreamSubscription? _talkStatusListener;
-  StreamSubscription? _talkBeanListener;
 
   GlobalKey repaintKey = GlobalKey();
 
@@ -37,9 +36,6 @@ class MindMapController extends BaseController {
   void onReady() async {
     super.onReady();
 
-    _talkBeanListener = talkController.talkBean.listen((bean) {
-      _dealTalkSummaryUpdate(bean?.summary.value);
-    });
     _talkStatusListener =
         talkController.talkBean.value?.status.listen((status) {
       if (status == TalkStatus.analysisSuccess) {
@@ -109,7 +105,6 @@ class MindMapController extends BaseController {
   @override
   void onClose() {
     super.onClose();
-    _talkBeanListener?.cancel();
     _talkStatusListener?.cancel();
     _talkSummaryListener?.cancel();
   }