2019-06-16 00:41:43 +02:00
|
|
|
import { ipcMain } from 'electron';
|
2019-06-30 01:18:21 +02:00
|
|
|
import nhentai from './../services/nhentai-crawler';
|
2019-06-16 00:41:43 +02:00
|
|
|
|
2019-06-30 01:18:21 +02:00
|
|
|
ipcMain.on(IpcChannels.Credentials, (event: IpcEvent, args: ICredentials) => {
|
|
|
|
nhentai
|
|
|
|
.login(args.name, args.password)
|
|
|
|
.then(() => {
|
|
|
|
console.log('success');
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
console.log('fail');
|
|
|
|
});
|
|
|
|
});
|