Skip to content

Commit

Permalink
refactor(chat): show sync status on history button
Browse files Browse the repository at this point in the history
  • Loading branch information
OrenZhang committed Feb 13, 2025
1 parent bccf2ce commit 5845f85
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/components/ChatInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const props = defineProps({
type: String,
default: '',
},
historySync: {
type: Boolean,
default: false,
},
});
// emits
Expand Down Expand Up @@ -551,6 +555,7 @@ defineExpose({reGenerate, promptForm});
@click="showHistory"
class="chat-input-left-button"
id="history-message-button"
:style="{backgroundColor: historySync ? 'rgb(var(--green-3))' : '', color: historySync ? 'white': ''}"
>
<icon-history />
</a-button>
Expand Down
3 changes: 2 additions & 1 deletion src/views/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ const setPromptForm = (data) => promptForm.value = data;
:local-messages="localMessages"
:chat-loading="chatLoading"
:system-define="systemDefine"
:history-sync="historySync"
@add-message="addMessage"
@set-chat-loading="setChatLoading"
@save-message="saveMessage"
Expand Down Expand Up @@ -355,7 +356,7 @@ const setPromptForm = (data) => promptForm.value = data;
{{ $t('StartNewChat') }}
</a-button>
<a-button
:style="{backgroundColor: historySync ? 'rgb(var(--green-3))' : '', color: 'white'}"
:style="{backgroundColor: historySync ? 'rgb(var(--green-3))' : '', color: historySync ? 'white': ''}"
@click="showHistorySyncConfig"
>
<template #icon>
Expand Down

0 comments on commit 5845f85

Please sign in to comment.