修改bug
This commit is contained in:
@@ -61,6 +61,18 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
/// 关键修复:Cell 复用时重置状态
|
||||
- (void)prepareForReuse {
|
||||
[super prepareForReuse];
|
||||
|
||||
// 停止音频播放
|
||||
[self.chatView stopPlayingAudio];
|
||||
|
||||
// 重置加载状态
|
||||
self.isLoading = NO;
|
||||
self.hasLoadedData = NO;
|
||||
}
|
||||
|
||||
#pragma mark - 1:控件初始化
|
||||
|
||||
- (void)setupUI {
|
||||
@@ -130,6 +142,8 @@
|
||||
self.nameLabel.text = persona.name;
|
||||
self.openingLabel.text = persona.shortDesc.length > 0 ? persona.shortDesc : persona.introText;
|
||||
|
||||
// 关键修复:清空消息时停止音频播放,避免状态混乱
|
||||
[self.chatView stopPlayingAudio];
|
||||
[self.chatView clearMessages];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user