(filePath = STORE_FILE)
| 20 | chats: {}, |
| 21 | |
| 22 | readFromFile(filePath = STORE_FILE) { |
| 23 | try { |
| 24 | if (fs.existsSync(filePath)) { |
| 25 | const data = JSON.parse(fs.readFileSync(filePath, 'utf-8')) |
| 26 | this.contacts = data.contacts || {} |
| 27 | this.chats = data.chats || {} |
| 28 | this.messages = data.messages || {} |
| 29 | |
| 30 | // Clean up any existing data to match new format |
| 31 | this.cleanupData() |
| 32 | } |
| 33 | } catch (e) { |
| 34 | console.warn('Failed to read store file:', e.message) |
| 35 | } |
| 36 | }, |
| 37 | |
| 38 | writeToFile(filePath = STORE_FILE) { |
| 39 | try { |
nothing calls this directly
no outgoing calls
no test coverage detected