From c9743cb363a23587eb5e9304062a5e9d0063da0e Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Wed, 11 Feb 2026 20:52:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=AC=AC=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E4=B8=8D=E6=BB=91=E5=8A=A8=E7=95=8C=E9=9D=A2=E4=B8=8D=E4=BC=A0?= =?UTF-8?q?=E9=80=92=E6=95=B0=E6=8D=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- keyBoard/Class/AiTalk/VC/KBAIHomeVC.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/keyBoard/Class/AiTalk/VC/KBAIHomeVC.m b/keyBoard/Class/AiTalk/VC/KBAIHomeVC.m index 31f066c..a8f8da3 100644 --- a/keyBoard/Class/AiTalk/VC/KBAIHomeVC.m +++ b/keyBoard/Class/AiTalk/VC/KBAIHomeVC.m @@ -308,6 +308,12 @@ static NSString * const KBAISelectedPersonaIdKey = @"KBAISelectedPersonaId"; if (weakSelf.currentPage == 1) { [weakSelf.collectionView reloadData]; [weakSelf preloadDataForIndexes:@[@0, @1, @2]]; + // 首次加载完成后,主动保存默认 persona 到 AppGroup, + // 避免用户未滑动时键盘扩展拿不到数据 + if (weakSelf.personas.count > 0) { + NSInteger index = MIN(MAX(weakSelf.currentIndex, 0), weakSelf.personas.count - 1); + [weakSelf saveSelectedPersonaToAppGroup:weakSelf.personas[index]]; + } } else if (pageModel.records.count > 0) { NSInteger newCount = weakSelf.personas.count; NSMutableArray *indexPaths = [NSMutableArray array];