Skip to content

Commit

Permalink
fix: fix broken timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
pionxzh committed Dec 24, 2023
1 parent b1ff972 commit 613247f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ function main() {

/** Insert timestamp to the bottom right of each message */
let chatId = ''
sentinel.on('main .group', async () => {
const threadContents = Array.from(document.querySelectorAll('main .group > .text-base > .relative:nth-child(2)'))
sentinel.on('[role="presentation"]', async () => {
const threadContents = Array.from(document.querySelectorAll('main [data-testid^="conversation-turn-"] [data-message-id]'))

const currentChatId = getChatIdFromUrl()
if (!currentChatId || currentChatId === chatId) return
Expand All @@ -59,7 +59,7 @@ function main() {
const date = new Date(createTime * 1000)

const timestamp = document.createElement('time')
timestamp.className = 'text-gray-500 dark:text-gray-400 text-sm text-right'
timestamp.className = 'w-full text-gray-500 dark:text-gray-400 text-sm text-right'
timestamp.dateTime = date.toISOString()
timestamp.title = date.toLocaleString()

Expand Down

0 comments on commit 613247f

Please sign in to comment.