Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
d0e934b4
"vscode:/vscode.git/clone" did not exist on "e4fe1cfbfb697b49a75b0c2727d55c232fd91544"
Commit
d0e934b4
authored
Jul 26, 2023
by
Jeffrey Morgan
Browse files
app: tray cleanup
parent
e751e47d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
app/src/index.ts
app/src/index.ts
+12
-15
No files found.
app/src/index.ts
View file @
d0e934b4
...
...
@@ -17,6 +17,7 @@ import * as path from 'path'
import
{
analytics
,
id
}
from
'
./telemetry
'
import
{
installed
}
from
'
./install
'
import
{
MenuItem
}
from
'
@electron/remote
'
require
(
'
@electron/remote/main
'
).
initialize
()
...
...
@@ -74,21 +75,17 @@ function firstRunWindow() {
let
tray
:
Tray
|
null
=
null
function
setTray
(
updateAvailable
:
boolean
)
{
const
menuItemAvailable
:
MenuItemConstructorOptions
=
{
label
:
'
Restart to update
'
,
click
:
()
=>
autoUpdater
.
quitAndInstall
(),
}
const
menuItemUpToDate
:
MenuItemConstructorOptions
=
{
label
:
'
Ollama is up to date
'
,
enabled
:
false
,
}
const
updateItems
:
MenuItemConstructorOptions
[]
=
[
{
label
:
'
An update is available
'
,
enabled
:
false
},
{
label
:
'
Restart to update
'
,
click
:
()
=>
autoUpdater
.
quitAndInstall
(),
},
{
type
:
'
separator
'
},
]
const
menu
=
Menu
.
buildFromTemplate
([
...(
updateAvailable
?
[{
label
:
'
An update is available
'
,
enabled
:
false
},
menuItemAvailable
]
:
[
menuItemUpToDate
]),
{
type
:
'
separator
'
},
...(
updateAvailable
?
updateItems
:
[]),
{
role
:
'
quit
'
,
label
:
'
Quit Ollama
'
,
accelerator
:
'
Command+Q
'
},
])
...
...
@@ -145,8 +142,6 @@ if (process.platform === 'darwin') {
}
app
.
on
(
'
ready
'
,
()
=>
{
setTray
(
false
)
if
(
app
.
isPackaged
)
{
heartbeat
()
autoUpdater
.
checkForUpdates
()
...
...
@@ -156,6 +151,8 @@ app.on('ready', () => {
},
60
*
60
*
1000
)
}
setTray
(
false
)
if
(
process
.
platform
===
'
darwin
'
)
{
if
(
app
.
isPackaged
)
{
if
(
!
app
.
isInApplicationsFolder
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment