Skip to content

Commit 358878d

Browse files
committed
Undo line splitting change
1 parent e809ab9 commit 358878d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/main/pages/warning/WarningPage.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -341,20 +341,21 @@ window.WarningSingleton = window.WarningSingleton || (function () {
341341
* Wraps system names text to fit within a specified maximum line length.
342342
*
343343
* @param text - The text to wrap, typically a comma-separated list of system names.
344-
* @param maxLineLength - The maximum length of each line before wrapping occurs.
345344
* @returns {string} - The wrapped text, with each line not exceeding the specified maximum length.
346345
*/
347-
function wrapSystemNamesText(text, maxLineLength = 100) {
346+
function wrapSystemNamesText(text) {
348347
const parts = text.split(', ');
349348
const lines = [];
350349
let currentLine = '';
351350

352-
for (let i = 0; i < parts.length; i++) {
353-
const part = parts[i];
354-
const segment = currentLine ? `, ${part}` : part;
351+
const isFirefox = typeof browser !== 'undefined';
352+
let maxLineLength = isFirefox ? 110 : 100;
355353

356-
if ((currentLine + segment).length <= maxLineLength) {
357-
currentLine += segment;
354+
for (const part of parts) {
355+
const nextSegment = currentLine ? `${currentLine}, ${part}` : part;
356+
357+
if (nextSegment.length <= maxLineLength) {
358+
currentLine = nextSegment;
358359
} else {
359360
if (currentLine) {
360361
lines.push(currentLine);

0 commit comments

Comments
 (0)