mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 09:50:15 +01:00
fixing convo state in progress
This commit is contained in:
parent
500b6c9fa8
commit
0e5c7c7721
5 changed files with 160 additions and 6 deletions
File diff suppressed because one or more lines are too long
|
|
@ -86,8 +86,8 @@ router.post('/', async (req, res) => {
|
|||
}
|
||||
|
||||
gptResponse.sender = 'GPT';
|
||||
|
||||
console.log('gptResponse', gptResponse);
|
||||
gptResponse.final = true;
|
||||
// console.log('gptResponse', gptResponse);
|
||||
|
||||
await saveMessage(gptResponse);
|
||||
await saveConvo(gptResponse);
|
||||
|
|
|
|||
|
|
@ -36,8 +36,10 @@ export default function TextChat({ messages, reloadConvos }) {
|
|||
dispatch(setMessages([...messages, currentMsg, { sender: 'GPT', text: data }]));
|
||||
};
|
||||
const convoHandler = (data) => {
|
||||
console.log('in convo handler');
|
||||
if (convo.conversationId === null && convo.parentMessageId === null) {
|
||||
const { title, conversationId, parentMessageId } = data;
|
||||
console.log('convo is null');
|
||||
dispatch(setConversation({ title, conversationId, parentMessageId: data.id }));
|
||||
}
|
||||
|
||||
|
|
|
|||
153
src/style.css
153
src/style.css
|
|
@ -239,3 +239,156 @@ button {
|
|||
background-color: transparent;
|
||||
border-radius: 9999px;
|
||||
}
|
||||
|
||||
body,html {
|
||||
height: 100%
|
||||
}
|
||||
|
||||
.dark body,.dark html {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgba(52,53,65,var(--tw-bg-opacity))
|
||||
}
|
||||
|
||||
#__next,#root {
|
||||
height: 100%
|
||||
}
|
||||
|
||||
.markdown ol {
|
||||
counter-reset: item
|
||||
}
|
||||
|
||||
.markdown ul li {
|
||||
display: block;
|
||||
margin: 0;
|
||||
position: relative
|
||||
}
|
||||
|
||||
.markdown ul li:before {
|
||||
content: "•";
|
||||
font-size: .875rem;
|
||||
line-height: 1.25rem;
|
||||
margin-left: -1rem;
|
||||
position: absolute
|
||||
}
|
||||
|
||||
.markdown {
|
||||
max-width: none
|
||||
}
|
||||
|
||||
.markdown h1,.markdown h2 {
|
||||
font-weight: 600
|
||||
}
|
||||
|
||||
.markdown h2 {
|
||||
margin-bottom: 1rem;
|
||||
margin-top: 2rem
|
||||
}
|
||||
|
||||
.markdown h3 {
|
||||
font-weight: 600
|
||||
}
|
||||
|
||||
.markdown h3,.markdown h4 {
|
||||
margin-bottom: .5rem;
|
||||
margin-top: 1rem
|
||||
}
|
||||
|
||||
.markdown h4 {
|
||||
font-weight: 400
|
||||
}
|
||||
|
||||
.markdown h5 {
|
||||
font-weight: 600
|
||||
}
|
||||
|
||||
.markdown blockquote {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgba(142,142,160,var(--tw-border-opacity));
|
||||
border-left-width: 2px;
|
||||
line-height: 1rem;
|
||||
padding-left: 1rem
|
||||
}
|
||||
|
||||
.markdown ol,.markdown ul {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 1rem
|
||||
}
|
||||
|
||||
.markdown ol li,.markdown ol li>p,.markdown ol ol,.markdown ol ul,.markdown ul li,.markdown ul li>p,.markdown ul ol,.markdown ul ul {
|
||||
margin: 0
|
||||
}
|
||||
|
||||
.markdown table {
|
||||
--tw-border-spacing-x: 0px;
|
||||
--tw-border-spacing-y: 0px;
|
||||
border-collapse: separate;
|
||||
border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y);
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.markdown th {
|
||||
background-color: rgba(236,236,241,.2);
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-width: 1px;
|
||||
padding: .25rem .75rem
|
||||
}
|
||||
|
||||
.markdown th:first-child {
|
||||
border-top-left-radius: .375rem
|
||||
}
|
||||
|
||||
.markdown th:last-child {
|
||||
border-right-width: 1px;
|
||||
border-top-right-radius: .375rem
|
||||
}
|
||||
|
||||
.markdown td {
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
padding: .25rem .75rem
|
||||
}
|
||||
|
||||
.markdown td:last-child {
|
||||
border-right-width: 1px
|
||||
}
|
||||
|
||||
.markdown tbody tr:last-child td:first-child {
|
||||
border-bottom-left-radius: .375rem
|
||||
}
|
||||
|
||||
.markdown tbody tr:last-child td:last-child {
|
||||
border-bottom-right-radius: .375rem
|
||||
}
|
||||
|
||||
.markdown a {
|
||||
text-decoration-line: underline;
|
||||
text-underline-offset: 2px
|
||||
}
|
||||
|
||||
.animate-flash {
|
||||
-webkit-animation: flash 2s steps(60,start);
|
||||
animation: flash 2s steps(60,start)
|
||||
}
|
||||
|
||||
@-webkit-keyframes flash {
|
||||
0% {
|
||||
background-color: hsla(0,0%,100%,.4)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes flash {
|
||||
0% {
|
||||
background-color: hsla(0,0%,100%,.4)
|
||||
}
|
||||
}
|
||||
|
||||
.truncate {
|
||||
overflow: hidden;
|
||||
white-space: nowrap
|
||||
}
|
||||
|
||||
.text-ellipsis,.truncate {
|
||||
text-overflow: ellipsis
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,9 +28,8 @@ export default function handleSubmit({
|
|||
events.onmessage = function (e) {
|
||||
const data = JSON.parse(e.data);
|
||||
if (!!data.message) {
|
||||
console.log('messageHandler data object', data);
|
||||
messageHandler(data.text.replace(/^\n/, ''));
|
||||
} else if (!data.initial) {
|
||||
} else if (!!data.final) {
|
||||
console.log(data);
|
||||
convoHandler(data);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue