diff --git a/public/javascripts/inquiry.js b/public/javascripts/inquiry.js index ba47f589b8..10fc1c252a 100644 --- a/public/javascripts/inquiry.js +++ b/public/javascripts/inquiry.js @@ -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}"`); }); });