Date: Thu, 25 May 2023 03:03:04 +0800
Subject: [PATCH 11/13] feat: change favicon when conversation icon is set
---
.../header/ConversationHeaderInfo.tsx | 4 +---
src/components/main/Conversation.tsx | 18 +++++++++++++++---
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/components/header/ConversationHeaderInfo.tsx b/src/components/header/ConversationHeaderInfo.tsx
index 3ede1092..563ca16d 100644
--- a/src/components/header/ConversationHeaderInfo.tsx
+++ b/src/components/header/ConversationHeaderInfo.tsx
@@ -1,4 +1,4 @@
-import { Show, createEffect } from 'solid-js'
+import { Show } from 'solid-js'
import { useStore } from '@nanostores/solid'
import { conversationMap, currentConversationId } from '@/stores/conversation'
import { useI18n } from '@/hooks'
@@ -11,8 +11,6 @@ export default () => {
return $conversationMap()[$currentConversationId()]
}
- createEffect(() => { document.title = currentConversation() ? `Anse • ${(currentConversation().name || t('conversations.untitled'))}` : 'Anse' })
-
return (
diff --git a/src/components/main/Conversation.tsx b/src/components/main/Conversation.tsx
index f84c4150..2085b28f 100644
--- a/src/components/main/Conversation.tsx
+++ b/src/components/main/Conversation.tsx
@@ -1,9 +1,10 @@
-import { Match, Switch } from 'solid-js'
+import { Match, Switch, createEffect } from 'solid-js'
import { useStore } from '@nanostores/solid'
import { conversationMap, currentConversationId } from '@/stores/conversation'
import { conversationMessagesMap } from '@/stores/messages'
import { loadingStateMap, streamsMap } from '@/stores/streams'
import { getBotMetaById } from '@/stores/provider'
+import { useI18n } from '@/hooks'
import ConversationEmpty from './ConversationEmpty'
import Welcome from './Welcome'
import Continuous from './Continuous'
@@ -11,6 +12,7 @@ import Single from './Single'
import Image from './Image'
export default () => {
+ const { t } = useI18n()
const $conversationMap = useStore(conversationMap)
const $conversationMessagesMap = useStore(conversationMessagesMap)
const $currentConversationId = useStore(currentConversationId)
@@ -26,8 +28,18 @@ export default () => {
const currentConversationMessages = () => {
return $conversationMessagesMap()[$currentConversationId()] || []
}
- const isStreaming = () => !!$streamsMap()[$currentConversationId()]
- const isLoading = () => !!$loadingStateMap()[$currentConversationId()]
+ // const isStreaming = () => !!$streamsMap()[$currentConversationId()]
+ // const isLoading = () => !!$loadingStateMap()[$currentConversationId()]
+
+ createEffect(() => {
+ const conversation = currentConversation()
+ document.title = conversation ? `${(conversation.name || t('conversations.untitled'))} • Anse` : 'Anse'
+ const link = document.querySelector("link[rel~='icon']") as HTMLLinkElement
+ if (link) {
+ const conversationIcon = conversation?.icon ? `data:image/svg+xml,` : null
+ link.setAttribute('href', conversationIcon || '/logo.svg')
+ }
+ })
return (
Date: Thu, 25 May 2023 03:40:07 +0800
Subject: [PATCH 12/13] chore: replace title hyphens
---
src/components/main/Conversation.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/main/Conversation.tsx b/src/components/main/Conversation.tsx
index 2085b28f..4467b346 100644
--- a/src/components/main/Conversation.tsx
+++ b/src/components/main/Conversation.tsx
@@ -33,7 +33,7 @@ export default () => {
createEffect(() => {
const conversation = currentConversation()
- document.title = conversation ? `${(conversation.name || t('conversations.untitled'))} • Anse` : 'Anse'
+ document.title = conversation ? `${(conversation.name || t('conversations.untitled'))} - Anse` : 'Anse'
const link = document.querySelector("link[rel~='icon']") as HTMLLinkElement
if (link) {
const conversationIcon = conversation?.icon ? `data:image/svg+xml,` : null
From 0e6efe71eb18672e2ae1d6df841181cab0eba361 Mon Sep 17 00:00:00 2001
From: yzh990918 <251205668@qq.com>
Date: Thu, 25 May 2023 17:51:58 +0800
Subject: [PATCH 13/13] chore: release v1.1.5
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 39cfc99e..d65dec66 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "anse",
- "version": "1.1.4",
+ "version": "1.1.5",
"packageManager": "pnpm@7.28.0",
"scripts": {
"dev": "astro dev",