feat: Introduce multi-platform architecture for Electron and Web clients with shared UI components, Convex backend for messaging, and integrated search functionality.
Some checks failed
Build and Release / build-and-release (push) Has been cancelled

This commit is contained in:
Bryan1029384756
2026-02-16 13:08:39 -06:00
parent 8ff9213b34
commit ec12313996
49 changed files with 2449 additions and 3914 deletions

View File

@@ -603,6 +603,43 @@ app.whenReady().then(async () => {
});
});
// --- Search DB file storage ---
const SEARCH_DIR = path.join(app.getPath('userData'), 'search');
ipcMain.handle('search-db-load', (event, userId) => {
try {
const filePath = path.join(SEARCH_DIR, `search-${userId}.db.enc`);
if (!fs.existsSync(filePath)) return null;
return new Uint8Array(fs.readFileSync(filePath));
} catch (err) {
console.error('Search DB load error:', err.message);
return null;
}
});
ipcMain.handle('search-db-save', (event, userId, data) => {
try {
if (!fs.existsSync(SEARCH_DIR)) fs.mkdirSync(SEARCH_DIR, { recursive: true });
const filePath = path.join(SEARCH_DIR, `search-${userId}.db.enc`);
fs.writeFileSync(filePath, Buffer.from(data));
return true;
} catch (err) {
console.error('Search DB save error:', err.message);
return false;
}
});
ipcMain.handle('search-db-clear', (event, userId) => {
try {
const filePath = path.join(SEARCH_DIR, `search-${userId}.db.enc`);
if (fs.existsSync(filePath)) fs.unlinkSync(filePath);
return true;
} catch (err) {
console.error('Search DB clear error:', err.message);
return false;
}
});
// AFK voice channel: expose system idle time to renderer
ipcMain.handle('get-system-idle-time', () => powerMonitor.getSystemIdleTime());