Newer
Older
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
/**
* Handle all asynchronous messages from renderer to main.
*/
Luke Schoen
committed
export default async (fetherAppWindow, event, action, ...args) => {
Luke Schoen
committed
if (!fetherAppWindow || !args[0]) {
Luke Schoen
committed
return;
}
Luke Schoen
committed
const [width] = fetherAppWindow.getContentSize();
Luke Schoen
committed
// Conversion to integer is required to pass as argument to setContentSize.
// Reference: https://electronjs.org/docs/all#winsetcontentsizewidth-height-animate
const newHeight = parseInt(args[0]);
Luke Schoen
committed
fetherAppWindow.setContentSize(width, Math.round(newHeight) + 2);
case 'check-clock-sync': {
checkClockSync().then(t => {
event.sender.send('check-clock-sync-reply', t);
case 'signer-new-token': {
const token = await signerNewToken();
// Send back the token to the renderer process
event.sender.send('signer-new-token-reply', token);