fix: frame name editing inconvenience (#7437)

This commit is contained in:
Ryan Di 2024-01-22 03:55:28 +08:00 committed by GitHub
parent b66daae1f3
commit 4997624a3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 5 deletions

View File

@ -676,12 +676,12 @@ export const getFrameLikeTitle = (
element: ExcalidrawFrameLikeElement, element: ExcalidrawFrameLikeElement,
frameIdx: number, frameIdx: number,
) => { ) => {
const existingName = element.name?.trim();
if (existingName) {
return existingName;
}
// TODO name frames AI only is specific to AI frames // TODO name frames AI only is specific to AI frames
return isFrameElement(element) ? `Frame ${frameIdx}` : `AI Frame ${frameIdx}`; return element.name === null
? isFrameElement(element)
? `Frame ${frameIdx}`
: `AI Frame $${frameIdx}`
: element.name;
}; };
export const getElementsOverlappingFrame = ( export const getElementsOverlappingFrame = (