check unicity when selected directory change#1044
Conversation
Signed-off-by: SOUISSI Maissa (Externe) <souissimai@gm0winl878.bureau.si.interne>
|
Mathieu-Deharbe
left a comment
There was a problem hiding this comment.
It corrects the bug but I don't really get it.
Just above we do :
const directory = selectedDirectory || activeDirectory;
And then when checking the name :
elementExists(activeDirectory ?? selectedDirectory
Ok it doesn't have the right value when calling handleCheckName but what is the point of directory if it is not used to check the name in the directory ?
I think it would be clearer if we simply send the directory that we wish to check to handleCheckName as a parameter.
| if (nameValue !== currentName && directory) { | ||
| elementExists(directory, nameValue, elementType) | ||
| elementExists(activeDirectory ?? selectedDirectory, nameValue, elementType) |
There was a problem hiding this comment.
Why do we check for directory if this is ot used in the following code anymore ? Shouldn't we check for selectedDirectory ?



PR Summary