After the node rendering operation, a JavaScript pop-up window is added, and then it is closed. When adding the node rendering again, an error will occur #1891
Unanswered
gamerssong
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
export const showModal = options => {
if (ipcRenderer) {
ipcRenderer.showModal(options)
} else {
const dialog = document.createElement('dialog')
dialog.style.width =
${options.width}px
dialog.style.height =
${options.height}px
dialog.className = 'rounded-5'
const iframe = document.createElement('iframe')
iframe.className = 'w-full h-full'
iframe.name = options.hash
iframe.allow = '*'
dialog.appendChild(iframe)
document.body.appendChild(dialog)
iframe.src =
${location.origin}${location.pathname}?noCache=${Date.now()}#/${options.hash}${QS.stringify(options.query, { addQueryPrefix: true })}
dialog.showModal()
const off = useEventListener(window, 'message', ({ data }) => {
if (data.hash === options.hash && data.type === 'close-modal') {
dialog.close()
document.body.removeChild(dialog)
off()
}
})
}
}
The above code generates a pop-up window and implements the closing function. In the flowchart, the operation of generating the pop-up window and then closing it is carried out. However, when the flowchart is rendered, an error occurs.
Closing the code for generating the pop-up window will prevent this problem from occurring.
Beta Was this translation helpful? Give feedback.
All reactions