📝 Rename the currencies

This commit is contained in:
2025-11-16 17:59:10 +08:00
parent 320664a547
commit d93b066979
4 changed files with 20 additions and 5 deletions

View File

@@ -54,6 +54,17 @@ class ThoughtScreen extends HookConsumerWidget {
? ref.watch(thoughtSequenceProvider(selectedSequenceId.value!))
: const AsyncValue<List<SnThinkingThought>>.data([]);
// Extract sequence ID from loaded thoughts for the chat interface
final sequenceIdFromThoughts = thoughts.maybeWhen(
data: (thoughts) {
if (thoughts.isNotEmpty && thoughts.first.sequenceId.isNotEmpty) {
return thoughts.first.sequenceId;
}
return null;
},
orElse: () => null,
);
// Get initial thoughts and topic from provider
final initialThoughts = thoughts.valueOrNull;
final initialTopic =
@@ -111,6 +122,7 @@ class ThoughtScreen extends HookConsumerWidget {
data:
(thoughtList) => ThoughtChatInterface(
initialThoughts: thoughtList,
initialSequenceId: sequenceIdFromThoughts,
initialTopic: initialTopic,
isDisabled: !status,
),

View File

@@ -1863,6 +1863,6 @@ class WalletScreen extends HookConsumerWidget {
}
const Map<String, IconData> kCurrencyIconData = {
'points': Symbols.toll,
'golds': Symbols.attach_money,
'points': Symbols.bolt,
'golds': Symbols.diamond,
};

View File

@@ -386,6 +386,7 @@ ThoughtChatState useThoughtChat(
class ThoughtChatInterface extends HookConsumerWidget {
final List<SnThinkingThought>? initialThoughts;
final String? initialSequenceId;
final String? initialTopic;
final List<Map<String, dynamic>> attachedMessages;
final List<String> attachedPosts;
@@ -394,6 +395,7 @@ class ThoughtChatInterface extends HookConsumerWidget {
const ThoughtChatInterface({
super.key,
this.initialThoughts,
this.initialSequenceId,
this.initialTopic,
this.attachedMessages = const [],
this.attachedPosts = const [],
@@ -407,6 +409,7 @@ class ThoughtChatInterface extends HookConsumerWidget {
final chatState = useThoughtChat(
ref,
initialSequenceId: initialSequenceId,
initialThoughts: initialThoughts,
initialTopic: initialTopic,
attachedMessages: attachedMessages,