fix: check for updates should show no update are availale on the latest build (#2075)
This commit is contained in:
parent
9244fb9367
commit
3ea8c6071c
@ -11,7 +11,8 @@ export function handleAppUpdates() {
|
|||||||
/* New Update Available */
|
/* New Update Available */
|
||||||
autoUpdater.on('update-available', async (_info: any) => {
|
autoUpdater.on('update-available', async (_info: any) => {
|
||||||
const action = await dialog.showMessageBox({
|
const action = await dialog.showMessageBox({
|
||||||
message: `Update available. Do you want to download the latest update?`,
|
title: 'Update Available',
|
||||||
|
message: 'Would you like to download and install it now?',
|
||||||
buttons: ['Download', 'Later'],
|
buttons: ['Download', 'Later'],
|
||||||
})
|
})
|
||||||
if (action.response === 0) await autoUpdater.downloadUpdate()
|
if (action.response === 0) await autoUpdater.downloadUpdate()
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
"main": "./build/main.js",
|
"main": "./build/main.js",
|
||||||
"author": "Jan <service@jan.ai>",
|
"author": "Jan <service@jan.ai>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"productName": "Jan",
|
||||||
"homepage": "https://github.com/janhq/jan/tree/main/electron",
|
"homepage": "https://github.com/janhq/jan/tree/main/electron",
|
||||||
"description": "Use offline LLMs with your own data. Run open source models like Llama2 or Falcon on your internal computers/servers.",
|
"description": "Use offline LLMs with your own data. Run open source models like Llama2 or Falcon on your internal computers/servers.",
|
||||||
"build": {
|
"build": {
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import { app, Menu, shell } from 'electron'
|
import { app, Menu, shell, dialog } from 'electron'
|
||||||
const isMac = process.platform === 'darwin'
|
|
||||||
import { autoUpdater } from 'electron-updater'
|
import { autoUpdater } from 'electron-updater'
|
||||||
|
import { log } from '@janhq/core/node'
|
||||||
|
const isMac = process.platform === 'darwin'
|
||||||
|
|
||||||
const template: (Electron.MenuItemConstructorOptions | Electron.MenuItem)[] = [
|
const template: (Electron.MenuItemConstructorOptions | Electron.MenuItem)[] = [
|
||||||
{
|
{
|
||||||
@ -12,7 +13,22 @@ const template: (Electron.MenuItemConstructorOptions | Electron.MenuItem)[] = [
|
|||||||
label: 'Check for Updates...',
|
label: 'Check for Updates...',
|
||||||
click: () =>
|
click: () =>
|
||||||
// Check for updates and notify user if there are any
|
// Check for updates and notify user if there are any
|
||||||
autoUpdater.checkForUpdatesAndNotify(),
|
autoUpdater
|
||||||
|
.checkForUpdatesAndNotify()
|
||||||
|
.then((updateCheckResult) => {
|
||||||
|
if (
|
||||||
|
!updateCheckResult?.updateInfo ||
|
||||||
|
updateCheckResult?.updateInfo.version === app.getVersion()
|
||||||
|
) {
|
||||||
|
dialog.showMessageBox({
|
||||||
|
message: `No updates available.`,
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
log('Error checking for updates:' + JSON.stringify(error))
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
{ role: 'services' },
|
{ role: 'services' },
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
"author": "MistralAI, The Bloke",
|
"author": "MistralAI, The Bloke",
|
||||||
"tags": ["Featured", "7B", "Foundational Model"],
|
"tags": ["Featured", "7B", "Foundational Model"],
|
||||||
"size": 4370000000,
|
"size": 4370000000,
|
||||||
"cover": "https://raw.githubusercontent.com/janhq/jan/main/models/mistral-ins-7b-q4/cover.png"
|
"cover": "https://raw.githubusercontent.com/janhq/jan/dev/models/mistral-ins-7b-q4/cover.png"
|
||||||
},
|
},
|
||||||
"engine": "nitro"
|
"engine": "nitro"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
"author": "Intel, Jan",
|
"author": "Intel, Jan",
|
||||||
"tags": ["7B", "Merged", "Featured"],
|
"tags": ["7B", "Merged", "Featured"],
|
||||||
"size": 4370000000,
|
"size": 4370000000,
|
||||||
"cover": "https://raw.githubusercontent.com/janhq/jan/main/models/openhermes-neural-7b/cover.png"
|
"cover": "https://raw.githubusercontent.com/janhq/jan/dev/models/openhermes-neural-7b/cover.png"
|
||||||
},
|
},
|
||||||
"engine": "nitro"
|
"engine": "nitro"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
"author": "Jan",
|
"author": "Jan",
|
||||||
"tags": ["7B", "Merged", "Featured"],
|
"tags": ["7B", "Merged", "Featured"],
|
||||||
"size": 4370000000,
|
"size": 4370000000,
|
||||||
"cover": "https://raw.githubusercontent.com/janhq/jan/main/models/trinity-v1.2-7b/cover.png"
|
"cover": "https://raw.githubusercontent.com/janhq/jan/dev/models/trinity-v1.2-7b/cover.png"
|
||||||
},
|
},
|
||||||
"engine": "nitro"
|
"engine": "nitro"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user