@@ -43,11 +43,12 @@ function runOllamaCommand() {
43
43
} ) ;
44
44
}
45
45
46
+ // Define the createWindow function
46
47
function createWindow ( ) {
47
48
// Create the browser window.
48
49
const mainWindow = new BrowserWindow ( {
49
50
// width: 800,
50
- // height: 1000 ,
51
+ height : 800 ,
51
52
webPreferences : {
52
53
preload : path . join ( __dirname , 'preload.js' )
53
54
}
@@ -60,39 +61,33 @@ function createWindow () {
60
61
// Open the DevTools.
61
62
// mainWindow.webContents.openDevTools()
62
63
mainWindow . webContents . openDevTools ( )
64
+
63
65
}
64
66
65
67
// This method will be called when Electron has finished
66
68
// initialization and is ready to create browser windows.
67
69
// Some APIs can only be used after this event occurs.
68
70
app . whenReady ( ) . then ( ( ) => {
69
- // checkOllama()
70
- // .then(createWindow)
71
- // .catch((error) => {
72
- // console.error('Failed to install or start Ollama:', error);
73
- // // Handle the error, maybe inform the user through a dialog
74
- // });
75
- // OllamaManager.startOllama();
76
- createWindow ( ) ;
77
- // app.on('activate', function () {
78
- // // On macOS it's common to re-create a window in the app when the
79
- // // dock icon is clicked and there are no other windows open.
80
- // if (BrowserWindow.getAllWindows().length === 0) createWindow();
81
- runOllamaCommand ( ) ; // Serve Ollama
71
+ // runOllamaCommand(); // Serve Ollama
82
72
createWindow ( ) ;
83
73
84
74
85
- // })
75
+
76
+ app . on ( 'activate' , function ( ) {
77
+ // On macOS it's common to re-create a window in the app when the
78
+ // dock icon is clicked and there are no other windows open.
79
+ if ( BrowserWindow . getAllWindows ( ) . length === 0 ) createWindow ( )
80
+ } )
86
81
} )
87
82
88
83
// Quit when all windows are closed, except on macOS. There, it's common
89
84
// for applications and their menu bar to stay active until the user quits
90
85
// explicitly with Cmd + Q.
91
86
// Quit when all windows are closed, and kill Ollama process
92
87
app . on ( 'window-all-closed' , function ( ) {
93
- if ( ollamaProcess !== null ) {
88
+ /* if (ollamaProcess !== null) {
94
89
ollamaProcess.kill(); // Kill Ollama process
95
- }
90
+ } */
96
91
if ( process . platform !== 'darwin' ) app . quit ( ) ;
97
92
} ) ;
98
93
@@ -104,13 +99,15 @@ app.on('window-all-closed', function() {
104
99
app . on ( 'before-quit' , function ( ) {
105
100
// This will handle the Cmd + Q case on macOS
106
101
// You can do any cleanup here before your application quits
107
- ollamaProcess . kill ( ) ; // Kill Ollama process
102
+ // ollamaProcess.kill(); // Kill Ollama process
108
103
} ) ;
109
104
110
105
app . on ( 'will-quit' , function ( ) {
111
106
// This will handle the Cmd + Q case on macOS
112
107
// You can do any cleanup here before your application quits
113
- ollamaProcess . kill ( ) ; // Kill Ollama process
108
+
109
+ // ollamaProcess.kill(); // Kill Ollama process
110
+
114
111
} ) ;
115
112
116
113
// In this file you can include the rest of your app's specific main process
0 commit comments