mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-06-06 05:51:19 +08:00
fix(agent,trader): guard nil TargetRef in skill handlers and fix toast indentation
- Add nil checks for session.TargetRef in all four execute*Action handlers (Trader/Exchange/Model/Strategy) to prevent panic on corrupted sessions; actions that don't need a target (query/query_list/create) are excluded. - Fix toast.success indentation in handleToggleTrader so success messages only fire when the API call actually succeeds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -298,10 +298,10 @@ export function AITradersPage({ onTraderSelect }: AITradersPageProps) {
|
||||
try {
|
||||
if (running) {
|
||||
await api.stopTrader(traderId)
|
||||
toast.success(t('aiTradersToast.stopped', language))
|
||||
toast.success(t('aiTradersToast.stopped', language))
|
||||
} else {
|
||||
await api.startTrader(traderId)
|
||||
toast.success(t('aiTradersToast.started', language))
|
||||
toast.success(t('aiTradersToast.started', language))
|
||||
}
|
||||
|
||||
await mutateTraders()
|
||||
|
||||
Reference in New Issue
Block a user