Explorar o código

Fix bug in `uniqueTitle`

`uniqueTitle` was returning a numbered title even when not necessary
John R. Supplee %!s(int64=4) %!d(string=hai) anos
pai
achega
9ec3574ff6
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      models/boards.js

+ 5 - 1
models/boards.js

@@ -1287,7 +1287,11 @@ Boards.uniqueTitle = title => {
     },
   );
 
-  return `${base} [${num + 1}]`;
+  if (num > 0) {
+    return `${base} [${num + 1}]`;
+  }
+
+  return title;
 };
 
 Boards.userSearch = (