🐛 Fix thought seq id didn't update
This commit is contained in:
@@ -194,8 +194,19 @@ class ThoughtScreen extends HookConsumerWidget {
|
|||||||
|
|
||||||
// Update current topic
|
// Update current topic
|
||||||
currentTopic.value = topic;
|
currentTopic.value = topic;
|
||||||
|
|
||||||
|
// Update selected sequence ID to provide context for AI
|
||||||
|
if (selectedSequenceId.value != aiThought.sequenceId) {
|
||||||
|
selectedSequenceId.value = aiThought.sequenceId;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
localThoughts.value = [aiThought, ...localThoughts.value];
|
localThoughts.value = [aiThought, ...localThoughts.value];
|
||||||
|
|
||||||
|
// Update selected sequence ID if it was null (new conversation)
|
||||||
|
if (selectedSequenceId.value == null &&
|
||||||
|
aiThought.sequenceId.isNotEmpty) {
|
||||||
|
selectedSequenceId.value = aiThought.sequenceId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showErrorAlert('Failed to parse AI response');
|
showErrorAlert('Failed to parse AI response');
|
||||||
@@ -248,9 +259,7 @@ class ThoughtScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
const Gap(8),
|
const Gap(8),
|
||||||
Text(
|
Text(
|
||||||
thought.role == ThinkingThoughtRole.assistant
|
thought.role == ThinkingThoughtRole.assistant ? 'SN 酱' : '您',
|
||||||
? 'AI Assistant'
|
|
||||||
: 'You',
|
|
||||||
style: Theme.of(context).textTheme.titleSmall,
|
style: Theme.of(context).textTheme.titleSmall,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user