Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions mito-ai/src/Extensions/VersionCheck/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type {
JupyterFrontEndPlugin
} from '@jupyterlab/application';
import { checkForUpdates } from '../../utils/version_check';
import { isElectronBasedFrontend } from '../../utils/user';

// Check interval - once per day in milliseconds
const CHECK_INTERVAL = 24 * 60 * 60 * 1000;
Expand Down Expand Up @@ -90,13 +89,6 @@ function updateLastCheckTime(): void {
* Performs the version check
*/
async function performVersionCheck(app: JupyterFrontEnd): Promise<void> {
// Skip version check when running in Electron (desktop app).
// Desktop users only need a single notification - when a new desktop app version is available.
// That new version of the desktop app will handle updating mito-ai automatically.
if (isElectronBasedFrontend()) {
return;
}

return checkForUpdates(app.serviceManager.serverSettings);
}

Expand Down
9 changes: 7 additions & 2 deletions mito-ai/src/utils/version_check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
import { ServerConnection } from '@jupyterlab/services';
import { Notification } from '@jupyterlab/apputils';
import * as semver from 'semver';
import { isElectronBasedFrontend } from './user';

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

/**
Expand All @@ -22,7 +24,10 @@ export function showVersionOutdatedNotification(currentVersion: string, latestVe
{
label: 'Learn how to update',
callback: () => {
window.open(DOCS_UPDATE_URL, '_blank');
window.open(
isElectronBasedFrontend() ? DESKTOP_DOCS_UPDATE_URL : PIP_DOCS_UPDATE_URL,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart!

'_blank'
);
}
},
{
Expand Down
Loading