1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Chore: Temporarily disable new auto-update code

This commit is contained in:
Laurent Cozic 2024-08-09 11:45:08 +01:00
parent 806377e6ee
commit a52b206dfb
2 changed files with 25 additions and 6 deletions

View File

@ -1,6 +1,6 @@
import Logger, { LoggerWrapper } from '@joplin/utils/Logger';
import { PluginMessage } from './services/plugins/PluginRunner';
import AutoUpdaterService from './services/autoUpdater/AutoUpdaterService';
// import AutoUpdaterService from './services/autoUpdater/AutoUpdaterService';
import shim from '@joplin/lib/shim';
import { isCallbackUrl } from '@joplin/lib/callbackUrlUtils';
@ -42,7 +42,7 @@ export default class ElectronAppWrapper {
private rendererProcessQuitReply_: RendererProcessQuitReply = null;
private pluginWindows_: PluginWindows = {};
private initialCallbackUrl_: string = null;
private updaterService_: AutoUpdaterService = null;
// private updaterService_: AutoUpdaterService = null;
private customProtocolHandler_: CustomProtocolHandler = null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
@ -476,10 +476,12 @@ export default class ElectronAppWrapper {
this.createWindow();
if (!shim.isLinux()) {
this.updaterService_ = new AutoUpdaterService();
this.updaterService_.startPeriodicUpdateCheck();
}
// TODO: Disabled for now - needs to be behind a feature flag
// if (!shim.isLinux()) {
// this.updaterService_ = new AutoUpdaterService();
// this.updaterService_.startPeriodicUpdateCheck();
// }
this.electronApp_.on('before-quit', () => {
this.willQuitApp_ = true;

View File

@ -59,6 +59,7 @@ const globalCommands = appCommands.concat(libCommands);
import editorCommandDeclarations from './gui/NoteEditor/editorCommandDeclarations';
import PerFolderSortOrderService from './services/sortOrder/PerFolderSortOrderService';
import ShareService from '@joplin/lib/services/share/ShareService';
import checkForUpdates from './checkForUpdates';
import { AppState } from './app.reducer';
import syncDebugLog from '@joplin/lib/services/synchronizer/syncDebugLog';
import eventManager, { EventName } from '@joplin/lib/eventManager';
@ -565,6 +566,22 @@ class Application extends BaseApplication {
value: Setting.value('flagOpenDevTools'),
});
// Note: Auto-update is a misnomer in the code.
// The code below only checks, if a new version is available.
// We only allow Windows and macOS users to automatically check for updates
if (shim.isWindows() || shim.isMac()) {
const runAutoUpdateCheck = () => {
if (Setting.value('autoUpdateEnabled')) {
void checkForUpdates(true, bridge().window(), { includePreReleases: Setting.value('autoUpdate.includePreReleases') });
}
};
// Initial check on startup
shim.setTimeout(() => { runAutoUpdateCheck(); }, 5000);
// Then every x hours
shim.setInterval(() => { runAutoUpdateCheck(); }, 12 * 60 * 60 * 1000);
}
initializeUserFetcher();
shim.setInterval(() => { void userFetcher(); }, 1000 * 60 * 60);