logseq-chatgpt-plugin
logseq-chatgpt-plugin copied to clipboard
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'style') at AskChatGPTHandler.ts:60:20
After using for a while, the "ask chatgpt" button disappeared with the following error message: "Uncaught (in promise) TypeError: Cannot read properties of null (reading 'style') at AskChatGPTHandler.ts:60:20".
// Show button if current page is a ChatGPT page only
const page = await logseq.Editor.getCurrentPage();
if (!(page.originalName && (page.properties?.type == "ChatGPT" || page.properties?.type == "[[ChatGPT]]"))) {
button.style.display = "none";
window.parent.document.getElementById("main-content-container").removeEventListener("scroll", window.parent.scrollFixForChatGPTPlugin);
return;
}
button.style.display = "block";