Spaces:
Paused
Paused
Download static/js/storage.load.js from reduxdev/OpenMythos: direct link, hf CLI and curl.
- Browser
- Download file 782 Bytes
-
https://huggingface.co/spaces/reduxdev/OpenMythos/resolve/main/static/js/storage.load.js
- Command line
-
hf download hf://spaces/reduxdev/OpenMythos/static/js/storage.load.js
-
curl -L -o storage.load.js https://huggingface.co/spaces/reduxdev/OpenMythos/resolve/main/static/js/storage.load.js
782 Bytes
| (_) => { | |
| const titles = JSON.parse(localStorage.getItem("titles") || "{}"); | |
| const conversations = []; | |
| const conversation_contexts = {}; | |
| for (const [id, data] of Object.entries(titles)) { | |
| const raw = localStorage.getItem("chat_id_" + id); | |
| if (raw) { | |
| const label = typeof data === 'string' ? data : data.label; | |
| const last_updated = typeof data === 'string' ? 0 : (data.last_updated || 0); | |
| conversations.push({ key: id, label: label, last_updated: last_updated }); | |
| conversation_contexts[id] = JSON.parse(raw); | |
| } | |
| } | |
| // Sort newest first | |
| conversations.sort((a, b) => (b.last_updated || 0) - (a.last_updated || 0)); | |
| return JSON.stringify({ conversations, conversation_contexts }); | |
| } |