Skip to content

Commit 008acfd

Browse files
authored
Update storage.js (messages, memory, session history)
better build messages function. memory improvements. sessions now have their own message history or should at least.
1 parent 4dd13f7 commit 008acfd

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

ai/storage.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
// storage.js with model persistence fix and improved session rendering
21
document.addEventListener("DOMContentLoaded", () => {
3-
const SERVER_URL = "https://your-hosted-server.com"; // Replace if you have a real server
4-
const USE_LOCAL_FALLBACK = true; // Set to false when your server is fully operational
2+
const SERVER_URL = "https://your-hosted-server.com";
3+
const USE_LOCAL_FALLBACK = true;
54

65
const sessionListEl = document.getElementById("session-list");
76
let sessions = loadSessions();
@@ -28,16 +27,13 @@ document.addEventListener("DOMContentLoaded", () => {
2827
getDefaultModel,
2928
setDefaultModel,
3029
clearAllSessions,
31-
// Memory
3230
getMemories,
3331
addMemory,
3432
removeMemory,
3533
clearAllMemories,
36-
// Destructive
3734
deleteAllUserData
3835
};
3936

40-
// Session functions
4137
function getSessions() {
4238
return sessions;
4339
}
@@ -208,7 +204,6 @@ document.addEventListener("DOMContentLoaded", () => {
208204
renderSessions();
209205
}
210206

211-
// Memory system
212207
function getMemories() {
213208
const raw = localStorage.getItem("pollinations_memory");
214209
return raw ? JSON.parse(raw) : [];
@@ -234,7 +229,6 @@ document.addEventListener("DOMContentLoaded", () => {
234229
location.reload();
235230
}
236231

237-
// Unique user ID & launch
238232
function initUserChecks() {
239233
let firstLaunch = localStorage.getItem("firstLaunch");
240234
if (firstLaunch === null) {
@@ -303,7 +297,7 @@ document.addEventListener("DOMContentLoaded", () => {
303297
updateVisitorCount();
304298
setInterval(() => {
305299
updateVisitorCount();
306-
}, 300000); // 5 min
300+
}, 300000);
307301
}
308302
async function updateVisitorCount() {
309303
const visitorDisplay = document.getElementById("visitor-count-display");

0 commit comments

Comments
 (0)