@@ -4,13 +4,12 @@ import db from "../db";
44import * as store from "../store" ;
55import * as actions from "../actions/actions" ;
66
7- const { api } = window ;
7+ const { api } = window ;
88
9-
10- api . receive ( 'add-collection' , ( ...args ) => {
11- console . log ( 'received data: ' , JSON . parse ( args . data ) ) ;
12- collectionsController . addCollectionToIndexedDb ( JSON . parse ( args . data ) ) ;
13- collectionsController . getCollections ( ) ;
9+ api . receive ( "add-collection" , ( ...args ) => {
10+ console . log ( "received data: " , JSON . parse ( args . data ) ) ;
11+ collectionsController . addCollectionToIndexedDb ( JSON . parse ( args . data ) ) ;
12+ collectionsController . getCollections ( ) ;
1413} ) ;
1514
1615const collectionsController = {
@@ -63,7 +62,7 @@ const collectionsController = {
6362 foundCollection . name += " import" ;
6463 foundCollection . id = uuid ( ) ;
6564
66- ipcRenderer . send ( "export-collection" , { collection : foundCollection } ) ;
65+ api . send ( "export-collection" , { collection : foundCollection } ) ;
6766 } )
6867 . catch ( ( error ) => {
6968 console . error ( error . stack || error ) ;
@@ -72,7 +71,7 @@ const collectionsController = {
7271 } ,
7372
7473 importCollection ( collection ) {
75- ipcRenderer . send ( "import-collection" , collection ) ;
74+ api . send ( "import-collection" , collection ) ;
7675 } ,
7776} ;
7877
0 commit comments