Skip to content

Commit cd98914

Browse files
committed
authors list bugfix
1 parent 8195ef4 commit cd98914

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

vis/js/templates/listentry/Details.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,17 @@ const getAuthorsString = (authorsList, maxLength) => {
4848
return "";
4949
}
5050

51+
const authorsListCopy = [...authorsList];
52+
5153
const ellipsis = "...";
5254
const join = ", ";
53-
let finalString = authorsList.shift();
54-
while (authorsList.length > 0) {
55-
const nextAuthor = authorsList.shift();
55+
let finalString = authorsListCopy.shift();
56+
while (authorsListCopy.length > 0) {
57+
const nextAuthor = authorsListCopy.shift();
5658
let nextPossibleLength =
5759
finalString.length + join.length + nextAuthor.length;
5860

59-
if (authorsList.length !== 0) {
61+
if (authorsListCopy.length !== 0) {
6062
nextPossibleLength += ellipsis.length;
6163
}
6264

0 commit comments

Comments
 (0)