(detail)
| 1174 | }; |
| 1175 | |
| 1176 | const refreshVisibleFolderForAutomationDetail = (detail) => { |
| 1177 | const job = (detail && typeof detail === 'object' && detail.job && typeof detail.job === 'object') ? detail.job : null; |
| 1178 | const payload = (job && job.payload && typeof job.payload === 'object') ? job.payload : null; |
| 1179 | const result = (payload && payload.aiResult && typeof payload.aiResult === 'object') ? payload.aiResult : null; |
| 1180 | if (!result) return; |
| 1181 | |
| 1182 | const mode = String(result.mode || '').trim().toLowerCase(); |
| 1183 | if (!['tag_images', 'images_tag', 'image_tagging', 'transcribe_audio_tag', 'audio_transcribe_tag', 'transcribe_audio'].includes(mode)) { |
| 1184 | return; |
| 1185 | } |
| 1186 | |
| 1187 | const resultSourceId = normalizeSourceId(result.sourceId || 'local'); |
| 1188 | const resultFolder = normalizeFolderPath(result.folder || 'root'); |
| 1189 | if (resultSourceId !== getActiveSourceId()) return; |
| 1190 | if (resultFolder !== getActiveFolder()) return; |
| 1191 | refreshFolderView(resultFolder); |
| 1192 | }; |
| 1193 | |
| 1194 | const refreshVisibleFolderForToolResult = (tool, ws) => { |
| 1195 | if (!tool || typeof tool !== 'object') return; |
no test coverage detected