Spaces:
Sleeping
Sleeping
vericudebuget
commited on
Commit
•
9a18272
1
Parent(s):
35833bf
Create chat.js
Browse files
chat.js
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function saveChat(history) {
|
2 |
+
localStorage.setItem('chat_history', JSON.stringify(history));
|
3 |
+
}
|
4 |
+
|
5 |
+
function loadChat() {
|
6 |
+
const history = JSON.parse(localStorage.getItem('chat_history') || '[]');
|
7 |
+
return history;
|
8 |
+
}
|