updateSessionLabelCache function

void updateSessionLabelCache(
  1. Map<String, String> labelsById,
  2. SessionRecord record
)

Implementation

void updateSessionLabelCache(
  Map<String, String> labelsById,
  SessionRecord record,
) {
  if (record is! LabelRecord) return;
  final label = record.label?.trim();
  if (label != null && label.isNotEmpty) {
    labelsById[record.targetId] = label;
  } else {
    labelsById.remove(record.targetId);
  }
}