1- // storage.js with model persistence fix and improved session rendering
21document . 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