Skip to content

Commit

Permalink
fix(chatgpt): fixed title not showing (#8778)
Browse files Browse the repository at this point in the history
* fix(chatgpt): fixed title not showing

* fix(chatgpt): fixed version bump

* fix(chatgpt): fixed title not showing when created a new chat

---------

Signed-off-by: Tschöggi <[email protected]>
  • Loading branch information
tschogge authored Oct 5, 2024
1 parent acd8cef commit 2d211bb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
10 changes: 8 additions & 2 deletions websites/C/ChatGPT/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
"id": "135058085386387457",
"name": "Extiriority"
},
"contributors": [
{
"name": "Kaktuswerk",
"id": "1167417152664522764"
}
],
"service": "ChatGPT",
"description": {
"en": "ChatGPT is a natural language processing tool driven by AI technology that allows you to have human-like conversations and much more with the chatbot. The language model can answer questions and assist you with tasks, such as composing emails, essays, and code."
},
"url": "chatgpt.com",
"version": "1.0.9",
"version": "1.1.0",
"logo": "https://cdn.rcd.gg/PreMiD/websites/C/ChatGPT/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/C/ChatGPT/assets/thumbnail.png",
"color": "#75AC9D",
Expand All @@ -30,4 +36,4 @@
"value": true
}
]
}
}
13 changes: 10 additions & 3 deletions websites/C/ChatGPT/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,16 @@ presence.on("UpdateData", async () => {
}

if (pathname.split("/")[1] === "c") {
presenceData.details = showTitle
? document.querySelector("li a button > svg")?.closest("li").textContent
: "Talking with AI about something";
// check if the document title is the default title. If so, get the chat title from the UI. Otherwise, get it from the document title
if (document.title === "ChatGPT" && showTitle) {
presenceData.details = document.querySelector(
`[href="/c/${pathname.split("/")[2]}"]`
)?.textContent;
} else {
presenceData.details = showTitle
? document.title
: "Talking with AI about something";
}
presenceData.state = isTalking
? "AI is responding..."
: `asked (${Number(
Expand Down

0 comments on commit 2d211bb

Please sign in to comment.