Skip to content

Commit

Permalink
feat: synchronize conversation name to document.title
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 authored May 21, 2023
1 parent 76c2b01 commit 2bcb2c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/header/ConversationHeaderInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Show } from 'solid-js'
import { Show, createEffect } from 'solid-js'
import { useStore } from '@nanostores/solid'
import { conversationMap, currentConversationId } from '@/stores/conversation'
import { useI18n } from '@/hooks'
Expand All @@ -11,6 +11,8 @@ export default () => {
return $conversationMap()[$currentConversationId()]
}

createEffect(() => { document.title = currentConversation() ? `Anse • ${(currentConversation().name || t('conversations.untitled'))}` : 'Anse' })

return (
<div class="fi gap-1 max-w-40vw px-2 overflow-hidden text-sm">
<Show when={currentConversation()}>
Expand Down

0 comments on commit 2bcb2c2

Please sign in to comment.