Merge pull request #5498 from JunYang-tes/main

fix: undefined in title
This commit is contained in:
Patrick Erichsen 2025-05-05 16:38:18 -07:00 • committed by GitHub
commit ffd8ba381d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -38,7 +38,7 @@ export function addModel(
(prev, curr) => (curr.title.startsWith(model.title) ? prev + 1 : prev),
0,
);
if (numMatches !== 0) {
if (numMatches !== undefined && numMatches > 0) {
model.title = `${model.title} (${numMatches})`;
}
@ -63,7 +63,7 @@ export function addModel(
"name" in curr && curr.name.startsWith(model.title) ? prev + 1 : prev,
0,
);
if (numMatches !== 0) {
if (numMatches !== undefined && numMatches > 0) {
model.title = `${model.title} (${numMatches})`;
}