LastIs reports whether the most recent message has the given type.
(typ types.MessageType)
| 169 | |
| 170 | // LastIs reports whether the most recent message has the given type. |
| 171 | func (t *Transcript) LastIs(typ types.MessageType) bool { |
| 172 | n := len(t.msgs) |
| 173 | return n > 0 && t.msgs[n-1].Type == typ |
| 174 | } |
| 175 | |
| 176 | // RemoveLast drops the most recent message when it has the given type, |
| 177 | // stopping its animation subscription (mirrors the message list's |
no outgoing calls