修复 KBChatPanel 发送内容校验

This commit is contained in:
2026-02-25 20:16:31 +08:00
parent 92ca5c6180
commit 82222afd76
5 changed files with 33 additions and 2 deletions

View File

@@ -93,13 +93,25 @@ static const NSUInteger kKBChatMessageLimit = 6;
NSString *trim =
[rawText stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString *textToClear = rawText;
if (trim.length == 0) {
//
//
NSString *fullTrim =
[fullText stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (fullTrim.length > 0) {
trim = fullTrim;
textToClear = fullText;
}
}
if (trim.length == 0) {
[KBHUD showInfo:KBLocalized(@"请输入内容")];
return;
}
[self kb_sendChatText:trim];
// 线
[self kb_clearHostInputForText:rawText];
//
[self kb_clearHostInputForText:textToClear];
}
- (void)kb_sendChatText:(NSString *)text {