event.js 498 B

1234567891011121314151617181920
  1. ipcRenderer.on('reset-app', (event, arg) => {
  2. loader();
  3. DataService.reset();
  4. RouterService.reload();
  5. });
  6. ipcRenderer.on('app-loader', (event, arg) => {
  7. loader();
  8. });
  9. ipcRenderer.on('import-card', (event, card) => {
  10. console.log(card);
  11. // If card with same id already exist
  12. if (localStorage.getItem(card.id)) {
  13. ipcRenderer.send('card-already-exist', card.id);
  14. } else {
  15. // Add card
  16. DataService.add(card.id, card.title, card.content);
  17. }
  18. });