Skip to content

Commit f34e675

Browse files
committed
fix(conflict): Retry one more time if left tree is not render done.
1 parent 09d965d commit f34e675

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/utils/icon.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,17 @@ interface CreateOptions {
145145
* @param iconName Name of the icon or emoji to add.
146146
* @param color Optional color of the icon to add.
147147
*/
148-
const createIconNode = (plugin: InvioPlugin, path: string, svgStr: string, color: string = '#44cf6e'): void => {
148+
const createIconNode = (plugin: InvioPlugin, path: string, svgStr: string, color: string = '#44cf6e', repeated: boolean): void => {
149149
// Get the container from the provided options or try to find the node that has the
150150
// path from the document itself.
151151
const node = document.querySelector(`[data-path="${path}"]`);
152152
if (!node) {
153153
console.error('element with data path not found', path);
154+
if (!repeated) {
155+
setTimeout(() => {
156+
createIconNode(plugin, path, svgStr, color, true);
157+
}, 3000)
158+
}
154159
return;
155160
}
156161

0 commit comments

Comments
 (0)