logseq-chatgpt-plugin icon indicating copy to clipboard operation
logseq-chatgpt-plugin copied to clipboard

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'style') at AskChatGPTHandler.ts:60:20

Open Chernfalin opened this issue 1 year ago • 3 comments

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";

Chernfalin avatar Apr 13 '23 08:04 Chernfalin