更新窗口名称和图标

This commit is contained in:
yuruo
2024-07-02 17:57:36 +08:00
parent 8939909954
commit 778afa7425
2 changed files with 8 additions and 2 deletions

View File

@@ -48,6 +48,13 @@ export const getWindowByName = (name: WindowNameType, router_url="")=>{
win = createWindow(config[name].options,router_url)
config[name].id = win.id
}
// 在页面加载完成后设置窗口标题
win.webContents.on('did-finish-load', () => {
win.setTitle('autoMate');
});
// 修改窗口图标 (需要提供图标的路径)
win.setIcon('resources/icon.png');
return win
}

View File

@@ -11,10 +11,10 @@ export default function Chat(props: {id: number, revalidator: () => void}) {
const chatMessages = useStore(state=>state.chatMessages)
const setMessages = useStore(state=>state.setChatMessage)
return (
<ProChatProvider>
<ProChat
chats={chatMessages}
onChatsChange={(chat)=>{
console.log('chat', chat)
setMessages(chat)
}}
chatRef={proChatRef}
@@ -29,7 +29,6 @@ export default function Chat(props: {id: number, revalidator: () => void}) {
return response// 支持流式和非流式
}}
/>
</ProChatProvider>
)
}