[WEB-5449] fix: enhance content check for unique ID generation and update issue loader condition (#8132)
This commit is contained in:
parent
2e6225a883
commit
b73cf4f0e2
3 changed files with 9 additions and 2 deletions
|
|
@ -191,7 +191,7 @@ export const InboxIssueMainContent: React.FC<Props> = observer((props) => {
|
||||||
containerClassName="-ml-3"
|
containerClassName="-ml-3"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{loader === "issue-loading" ? (
|
{loader === "issue-loading" || issue.description_html === undefined ? (
|
||||||
<DescriptionInputLoader />
|
<DescriptionInputLoader />
|
||||||
) : (
|
) : (
|
||||||
<DescriptionInput
|
<DescriptionInput
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ export const UniqueID = Extension.create<UniqueIDOptions>({
|
||||||
// If not synced, the listener will be registered in the plugin
|
// If not synced, the listener will be registered in the plugin
|
||||||
// and handled there with proper cleanup
|
// and handled there with proper cleanup
|
||||||
} else {
|
} else {
|
||||||
return createIdsForView(this.editor.view, this.options);
|
createIdsForView(this.editor.view, this.options);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,13 @@ export const createIdsForView = (view: EditorView, options: UniqueIDOptions) =>
|
||||||
const { state } = view;
|
const { state } = view;
|
||||||
const { tr, doc } = state;
|
const { tr, doc } = state;
|
||||||
const { types, attributeName, generateUniqueID } = options;
|
const { types, attributeName, generateUniqueID } = options;
|
||||||
|
|
||||||
|
// size > 2 means more than just the default empty paragraph
|
||||||
|
const hasContent = doc.content.size > 2;
|
||||||
|
if (!hasContent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const nodesWithoutId = findChildren(
|
const nodesWithoutId = findChildren(
|
||||||
doc,
|
doc,
|
||||||
(node) => types.includes(node.type.name) && node.attrs[attributeName] === null
|
(node) => types.includes(node.type.name) && node.attrs[attributeName] === null
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue