Răsfoiți Sursa

Fix project auto-generated name not stopping after encountering word with bracket

Alan Lam 2 ani în urmă
părinte
comite
0293d58bfa
1 a modificat fișierele cu 7 adăugiri și 3 ștergeri
  1. 7 3
      public/js/app-project-form.js

+ 7 - 3
public/js/app-project-form.js

@@ -209,10 +209,14 @@ function autogenProjectName() {
 	const timeOfDay = $("#time-of-day").find("option:selected").text();
 
 	const templateWords = templateName.split(" ");
-	const templateWordCount = templateWords.length;
 	const templateInitials = [];
-	for(let i = 0; i < templateWordCount; i++) {
-		templateInitials.push(templateWords[i].charAt(0));
+
+	for(const templateWord of templateWords) {
+		const initial = templateWord.charAt(0);
+		if(initial === "(") {
+			break;
+		}
+		templateInitials.push(templateWord.charAt(0));
 	}
 
 	const templateKeys = getCheckedTemplateKeys();