clearPendingAgentMessagesForThread method

void clearPendingAgentMessagesForThread(
  1. String threadPath
)

Implementation

void clearPendingAgentMessagesForThread(String threadPath) {
  if (threadPath.trim().isEmpty || _pendingAgentMessages.isEmpty) {
    return;
  }

  var changed = false;
  _pendingAgentMessages.removeWhere((_, message) {
    if (message.threadPath != threadPath) {
      return false;
    }
    changed = true;
    return true;
  });
  if (changed) {
    notifyListeners();
  }
}