File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ function createDatabaseWindow(conn: ConnectionStoreItem) {
6262 show : false ,
6363 width : 1024 ,
6464 height : 768 ,
65- // autoHideMenuBar: true,
65+ autoHideMenuBar : true ,
6666 webPreferences : {
6767 devTools : true ,
6868 additionalArguments : [ "--database=" + conn . id ] ,
@@ -74,7 +74,7 @@ function createDatabaseWindow(conn: ConnectionStoreItem) {
7474
7575 const queryString = new URLSearchParams ( { name : conn . name } ) . toString ( ) ;
7676
77- dbWindow . on ( "close " , ( ) => {
77+ dbWindow . on ( "closed " , ( ) => {
7878 win ?. show ( ) ;
7979 ConnectionPool . close ( conn . id ) ;
8080 } ) ;
@@ -200,6 +200,12 @@ ipcMain.handle(
200200 } ,
201201) ;
202202
203+ ipcMain . handle ( "close" , async ( sender ) => {
204+ sender . sender . close ( {
205+ waitForBeforeUnload : true ,
206+ } ) ;
207+ } ) ;
208+
203209ipcMain . handle ( "connect" , ( _ , conn : ConnectionStoreItem ) => {
204210 createDatabaseWindow ( conn ) ;
205211 if ( win ) win . hide ( ) ;
Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ const outerbaseIpc = {
4646 return ipcRenderer . invoke ( "transaction" , connectionId , statements ) ;
4747 } ,
4848
49+ close ( ) {
50+ return ipcRenderer . invoke ( "close" ) ;
51+ } ,
52+
4953 connect ( conn : ConnectionStoreItem ) {
5054 return ipcRenderer . invoke ( "connect" , conn ) ;
5155 } ,
You can’t perform that action at this time.
0 commit comments