@arbidocs/tui 0.5.136 → 0.5.138

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2300,7 +2300,8 @@ var DURATION_BY_LEVEL = {
2300
2300
  function isChatMessage(msg) {
2301
2301
  return msg.type === "chat.message";
2302
2302
  }
2303
- function shouldToast(level, msgType) {
2303
+ function shouldToast(level, msgType, uploadSetBatch = false) {
2304
+ if (uploadSetBatch) return false;
2304
2305
  if (level === "error" || level === "warning" || level === "success") return true;
2305
2306
  if (msgType === "response_complete" || msgType === "batch_complete") return true;
2306
2307
  return false;
@@ -2313,7 +2314,8 @@ async function handleMessage(msg, toasts, eventLog, tui) {
2313
2314
  const { text, level } = sdk.formatWsMessage(msg);
2314
2315
  const msgType = msg.type;
2315
2316
  eventLog.add({ text, level, msgType });
2316
- if (shouldToast(level, msgType)) {
2317
+ const uploadSetBatch = msgType === "batch_complete" && !!msg.upload_set_id;
2318
+ if (shouldToast(level, msgType, uploadSetBatch)) {
2317
2319
  const duration = DURATION_BY_LEVEL[level] ?? DURATION_DEFAULT;
2318
2320
  toasts.show(text, level, duration);
2319
2321
  }