Add key attr to log lines

This commit is contained in:
Simon Ser 2020-06-28 15:13:06 +02:00
parent d1663315e3
commit 73f14f38fa
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
2 changed files with 6 additions and 1 deletions

View File

@ -12,6 +12,8 @@ import { BufferType, Status, Unread } from "/state.js";
const SERVER_BUFFER = "*";
var messagesCount = 0;
function parseQueryString() {
var query = window.location.search.substring(1);
var params = {};
@ -144,6 +146,9 @@ export default class App extends Component {
}
addMessage(bufName, msg) {
msg.key = messagesCount;
messagesCount++;
if (!msg.tags) {
msg.tags = {};
}

View File

@ -98,7 +98,7 @@ export default function Buffer(props) {
return html`
<div class="logline-list">
${props.buffer.messages.map((msg) => html`
<${LogLine} message=${msg} onNickClick=${props.onNickClick}/>
<${LogLine} key=${msg.key} message=${msg} onNickClick=${props.onNickClick}/>
`)}
</div>
`;