diff --git a/electron_app/src/electron-main.js b/electron_app/src/electron-main.js index 6e477f90..11b28258 100644 --- a/electron_app/src/electron-main.js +++ b/electron_app/src/electron-main.js @@ -381,6 +381,17 @@ ipcMain.on('seshat', async function(ev, payload) { } break; + case 'indexSize': + if (eventIndex === null) ret = 0; + else { + try { + ret = await eventIndex.getSize(); + } catch (e) { + ret = 0; + } + } + break; + default: mainWindow.webContents.send('seshatReply', { id: payload.id, diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index 9968504a..02f2e62b 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -155,6 +155,10 @@ class SeshatIndexManager extends BaseEventIndexManager { async deleteEventIndex(): Promise<> { return this._ipcCall('deleteEventIndex'); } + + async indexSize(): Promise<> { + return this._ipcCall('indexSize'); + } } export default class ElectronPlatform extends VectorBasePlatform {