Make click-to-note safer to use.

Include the username to avoid noting messages from user B on user A.
pull/9536/head
kraktus 2021-08-06 08:56:19 +02:00
parent c040432554
commit 3f76213071
1 changed files with 4 additions and 1 deletions

View File

@ -39,8 +39,11 @@ $(function () {
});
$('#communication').on('click', '.line.author, .post.author', function () {
// Need to take username from the communcation page so that when being in inquiry for user A and checking communication of user B
// the notes cannot be mistakenly attributed to user A.
const username = $('#communication').find('.title').text().split(' ')[0];
const message = $(this).find('.message').text();
const storedNote = noteStore.get();
noteStore.set((storedNote ? storedNote + ', ' : '') + `"${message}"`);
noteStore.set((storedNote ? storedNote + ', ' : '') + `${username}: "${message}"`);
});
});