Conversation
src/FormattingSettingsService.ts
Outdated
There was a problem hiding this comment.
Create selector map here inside the method, You dont need to pass it from another method as a parameter
src/FormattingSettingsService.ts
Outdated
There was a problem hiding this comment.
this map can be <string, [selector:string]>, In other wrods map of string which is the key to list of strings where its the selectors values list
You can add entry for slice name and its selectors, if a specific selector exist in the list it means it exist, no need for boolean
src/FormattingSettingsService.ts
Outdated
There was a problem hiding this comment.
Please dont add and wrong ways, Since people will not know what was the main problem to create this.
So add description that we are supporting slices with same, And if selector (specify its not altConstantSelector) is different we keep the same uid for the slice, if not we have to change the uid (or else it wont work)
and add that the way when the slice name is similar and selector is different is the recommended way
|
|
||
| if (formattingSlice) { | ||
| // Modify formatting slice uid if needed | ||
| const sliceName = slice.name; |
There was a problem hiding this comment.
Why don't you use this variable below?
src/FormattingSettingsService.ts
Outdated
There was a problem hiding this comment.
Better to replace undefined with false
src/FormattingSettingsService.ts
Outdated
There was a problem hiding this comment.
Create a variable for JSON.stringify(sliceSelector) as it is used in three places
This changes provide support for slices with the same name if they differ in the selector field (not in the altConstantSelector).
If the slices with the same name have different selectors we keep the uid as is, else we change it.
We recommend using different selectors in the selector field for slices with the same name.