Skip to content

Commit 678cdde

Browse files
authored
Merge pull request #2079 from mito-ds/feature/re-add-version-check-desktop
Re-add Desktop Version Check
2 parents b2ca344 + 589cfc0 commit 678cdde

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

mito-ai/src/Extensions/VersionCheck/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type {
88
JupyterFrontEndPlugin
99
} from '@jupyterlab/application';
1010
import { checkForUpdates } from '../../utils/version_check';
11-
import { isElectronBasedFrontend } from '../../utils/user';
1211

1312
// Check interval - once per day in milliseconds
1413
const CHECK_INTERVAL = 24 * 60 * 60 * 1000;
@@ -90,13 +89,6 @@ function updateLastCheckTime(): void {
9089
* Performs the version check
9190
*/
9291
async function performVersionCheck(app: JupyterFrontEnd): Promise<void> {
93-
// Skip version check when running in Electron (desktop app).
94-
// Desktop users only need a single notification - when a new desktop app version is available.
95-
// That new version of the desktop app will handle updating mito-ai automatically.
96-
if (isElectronBasedFrontend()) {
97-
return;
98-
}
99-
10092
return checkForUpdates(app.serviceManager.serverSettings);
10193
}
10294

mito-ai/src/utils/version_check.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
import { ServerConnection } from '@jupyterlab/services';
77
import { Notification } from '@jupyterlab/apputils';
88
import * as semver from 'semver';
9+
import { isElectronBasedFrontend } from './user';
910

1011
const VERSION_CHECK_TIMEOUT = 5000;
1112
const VERSION_CHECK_ENDPOINT = 'mito-ai/version-check';
12-
const DOCS_UPDATE_URL = 'https://docs.trymito.io/getting-started/installing-mito';
13+
const DESKTOP_DOCS_UPDATE_URL = 'https://docs.trymito.io/getting-started/installing-mito/upgrading-mito-desktop#how-can-i-update-mito-ai';
14+
const PIP_DOCS_UPDATE_URL = 'https://docs.trymito.io/how-to/upgrading-mito';
1315
const RELEASE_NOTES_URL = 'https://docs.trymito.io/misc/release-notes';
1416

1517
/**
@@ -22,7 +24,10 @@ export function showVersionOutdatedNotification(currentVersion: string, latestVe
2224
{
2325
label: 'Learn how to update',
2426
callback: () => {
25-
window.open(DOCS_UPDATE_URL, '_blank');
27+
window.open(
28+
isElectronBasedFrontend() ? DESKTOP_DOCS_UPDATE_URL : PIP_DOCS_UPDATE_URL,
29+
'_blank'
30+
);
2631
}
2732
},
2833
{

0 commit comments

Comments
 (0)