Browse Source

fix(nc-gui): check if sheet exists on name generation

pull/3801/head
braks 2 years ago
parent
commit
1ce9dcc420
  1. 2
      packages/nc-gui/utils/generateName.ts

2
packages/nc-gui/utils/generateName.ts

@ -14,7 +14,7 @@ export const generateUniqueTitle = <T extends Record<string, any> = Record<strin
predicate: keyof T,
) => {
let c = 1
while (arr.some((item) => item[predicate] === (`${title}-${c}` as keyof T))) {
while (arr.some((item) => item[predicate].includes(`${title}-${c}` as keyof T))) {
c++
}

Loading…
Cancel
Save