Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async updateData(
table: string,
update: IIPCUpdateDataUpdate,
where?: IIPCUpdateDataWhere[]
): Promise {
const req: IPCUpdateDataRequestMessage = new IPCUpdateDataRequestMessage({
table: table,
update: update,
where: where
});
console.log("req", req);
const rawRes:any = await ipcRenderer.callMain(IPC_CHANNEL_UPDATE_DATA, req.toJsonValue());
console.log("rawRes", rawRes);
return new IPCUpdateDataResponseMessage(rawRes).toMessage()
}
updateShortcut = async (setting, shortcut) => {
try {
await ipc.callMain('update-shortcut', {setting, shortcut});
this.setState({[setting]: shortcut});
} catch (error) {
console.warn('Error updating shortcut', error);
}
}
public async listOfTables(): Promise {
const req: IPCListOfTablesRequestMessage = new IPCListOfTablesRequestMessage({});
console.log("req", req);
const rawRes:any = await ipcRenderer.callMain(IPC_CHANNEL_LIST_OF_TABLES, req.toJsonValue());
console.log("rawRes", rawRes);
return new IPCListOfTablesResponseMessage(rawRes).toMessage()
}
public async checkConnection(account: IAccount): Promise {
const req: IPCCheckConnectionRequestMessage = new IPCCheckConnectionRequestMessage({
server: account.server,
ssh: account.ssh
});
const rawRes:any = await ipcRenderer.callMain(IPC_CHANNEL_CHECK_CONNECTION, req.toJsonValue());
console.log("rawRes", rawRes);
return new IPCCheckConnectionResponseMessage(rawRes).toMessage()
}
removeProfile(profileId) {
ipc.callMain('remove-profile', profileId).then(({profiles, activeProfileId}) => {
this.setState({profiles, activeProfileId})
})
}
startTime,
endTime,
isMuted
},
inputPath: originalFilePath || filePath,
previewPath: filePath,
plugin,
serviceTitle,
format,
originalFps,
isNewRecording,
openWithApp
};
ipc.callMain('export', data);
ipc.callMain('update-usage', {format, plugin: plugin.pluginName});
}
}
setTimeout(() => ipc.callMain('preferences-ready'), 300);
}
saveOriginal = () => {
const {filePath, originalFilePath} = this.state;
ipc.callMain('save-original', {inputPath: originalFilePath || filePath});
}
componentDidUpdate() {
ipc.callMain('about-ready');
}
toggleShortcuts = async () => {
const setting = 'recordKeyboardShortcut';
const newVal = !this.state[setting];
this.toggleSetting(setting, newVal);
await ipc.callMain('toggle-shortcuts', {enabled: newVal});
}