refac: chat input object localStorage -> sessionStorage

This commit is contained in:
Timothy Jaeryang Baek
2025-06-18 16:02:29 +04:00
parent 34440f95dc
commit 1547235d47
4 changed files with 17 additions and 13 deletions
+8 -4
View File
@@ -164,7 +164,9 @@
<Tooltip
className=" w-fit"
content={marked.parse(
sanitizeResponseContent(models[selectedModelIdx]?.info?.meta?.description ?? '').replaceAll('\n', '<br>')
sanitizeResponseContent(
models[selectedModelIdx]?.info?.meta?.description ?? ''
).replaceAll('\n', '<br>')
)}
placement="top"
>
@@ -172,7 +174,9 @@
class="mt-0.5 px-2 text-sm font-normal text-gray-500 dark:text-gray-400 line-clamp-2 max-w-xl markdown"
>
{@html marked.parse(
sanitizeResponseContent(models[selectedModelIdx]?.info?.meta?.description ?? '').replaceAll('\n', '<br>')
sanitizeResponseContent(
models[selectedModelIdx]?.info?.meta?.description ?? ''
).replaceAll('\n', '<br>')
)}
</div>
</Tooltip>
@@ -218,9 +222,9 @@
onChange={(input) => {
if (!$temporaryChatEnabled) {
if (input.prompt !== null) {
localStorage.setItem(`chat-input`, JSON.stringify(input));
sessionStorage.setItem(`chat-input`, JSON.stringify(input));
} else {
localStorage.removeItem(`chat-input`);
sessionStorage.removeItem(`chat-input`);
}
}
}}