This commit is contained in:
2026-02-02 15:28:00 +08:00
parent ea9c40f64f
commit 0ac9030f80
3 changed files with 16 additions and 2 deletions

View File

@@ -546,6 +546,10 @@ static NSString * const KBChatSessionDidResetNotification = @"KBChatSessionDidRe
if (self.persona && self.persona.personaId == companionId) { if (self.persona && self.persona.personaId == companionId) {
NSLog(@"[KBPersonaChatCell] 收到聊天重置通知companionId=%ld, 清空聊天记录", (long)companionId); NSLog(@"[KBPersonaChatCell] 收到聊天重置通知companionId=%ld, 清空聊天记录", (long)companionId);
self.shouldAutoPlayPrologueAudio = NO;
self.hasPlayedPrologueAudio = NO;
[self.chatView stopPlayingAudio];
// //
self.messages = [NSMutableArray array]; self.messages = [NSMutableArray array];
self.hasLoadedData = NO; self.hasLoadedData = NO;

View File

@@ -46,7 +46,7 @@
[super viewDidLoad]; [super viewDidLoad];
self.kb_navView.hidden = YES; self.kb_navView.hidden = YES;
self.view.backgroundColor = [UIColor blackColor]; // self.view.backgroundColor = [UIColor blackColor];
self.aiVM = [[AiVM alloc] init]; self.aiVM = [[AiVM alloc] init];
/// 1 /// 1
@@ -261,7 +261,7 @@
- (UIButton *)closeButton { - (UIButton *)closeButton {
if (!_closeButton) { if (!_closeButton) {
_closeButton = [UIButton buttonWithType:UIButtonTypeCustom]; _closeButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_closeButton setImage:[UIImage imageNamed:@"comment_close_icon"] forState:UIControlStateNormal]; [_closeButton setImage:[UIImage imageNamed:@"ai_close_icon"] forState:UIControlStateNormal];
[_closeButton addTarget:self action:@selector(closeButtonTapped) forControlEvents:UIControlEventTouchUpInside]; [_closeButton addTarget:self action:@selector(closeButtonTapped) forControlEvents:UIControlEventTouchUpInside];
} }
return _closeButton; return _closeButton;

View File

@@ -159,6 +159,16 @@
} }
} }
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
for (NSIndexPath *indexPath in self.collectionView.indexPathsForVisibleItems) {
KBPersonaChatCell *cell = (KBPersonaChatCell *)[self.collectionView cellForItemAtIndexPath:indexPath];
if (cell) {
[cell onResignedCurrentPersonaCell];
}
}
}
- (void)viewDidLayoutSubviews { - (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews]; [super viewDidLayoutSubviews];
if (self.bottomMaskLayer) { if (self.bottomMaskLayer) {