1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00
This commit is contained in:
Laurent Cozic
2025-03-09 09:38:05 +00:00
parent 64d0bec2c5
commit 04666be15f

View File

@@ -4,15 +4,12 @@ import AutoUpdaterService, { defaultUpdateInterval, initialUpdateStartup } from
import type ShimType from '@joplin/lib/shim'; import type ShimType from '@joplin/lib/shim';
const shim: typeof ShimType = require('@joplin/lib/shim').default; const shim: typeof ShimType = require('@joplin/lib/shim').default;
import { isCallbackUrl } from '@joplin/lib/callbackUrlUtils'; import { isCallbackUrl } from '@joplin/lib/callbackUrlUtils';
import { BrowserWindow, Tray, WebContents, screen, App, Event, dialog, ipcMain } from 'electron';
import { BrowserWindow, Tray, WebContents, screen } from 'electron';
import bridge from './bridge'; import bridge from './bridge';
const url = require('url'); const url = require('url');
const path = require('path'); const path = require('path');
const { dirname } = require('@joplin/lib/path-utils'); const { dirname } = require('@joplin/lib/path-utils');
const fs = require('fs-extra'); const fs = require('fs-extra');
import { dialog, ipcMain } from 'electron';
import { _ } from '@joplin/lib/locale'; import { _ } from '@joplin/lib/locale';
import restartInSafeModeFromMain from './utils/restartInSafeModeFromMain'; import restartInSafeModeFromMain from './utils/restartInSafeModeFromMain';
import handleCustomProtocols, { CustomProtocolHandler } from './utils/customProtocols/handleCustomProtocols'; import handleCustomProtocols, { CustomProtocolHandler } from './utils/customProtocols/handleCustomProtocols';
@@ -36,8 +33,7 @@ interface SecondaryWindowData {
export default class ElectronAppWrapper { export default class ElectronAppWrapper {
private logger_: Logger = null; private logger_: Logger = null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied private electronApp_: App;
private electronApp_: any;
private env_: string; private env_: string;
private isDebugMode_: boolean; private isDebugMode_: boolean;
private profilePath_: string; private profilePath_: string;
@@ -48,8 +44,7 @@ export default class ElectronAppWrapper {
private secondaryWindows_: Map<SecondaryWindowId, SecondaryWindowData> = new Map(); private secondaryWindows_: Map<SecondaryWindowId, SecondaryWindowData> = new Map();
private willQuitApp_ = false; private willQuitApp_ = false;
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied private tray_: Tray = null;
private tray_: any = null;
private buildDir_: string = null; private buildDir_: string = null;
private rendererProcessQuitReply_: RendererProcessQuitReply = null; private rendererProcessQuitReply_: RendererProcessQuitReply = null;
@@ -59,8 +54,7 @@ export default class ElectronAppWrapper {
private updatePollInterval_: ReturnType<typeof setTimeout>|null = null; private updatePollInterval_: ReturnType<typeof setTimeout>|null = null;
private isAltInstance_: boolean; private isAltInstance_: boolean;
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied public constructor(electronApp: App, env: string, profilePath: string|null, isDebugMode: boolean, initialCallbackUrl: string, isAltInstance: boolean) {
public constructor(electronApp: any, env: string, profilePath: string|null, isDebugMode: boolean, initialCallbackUrl: string, isAltInstance: boolean) {
this.electronApp_ = electronApp; this.electronApp_ = electronApp;
this.env_ = env; this.env_ = env;
this.isDebugMode_ = isDebugMode; this.isDebugMode_ = isDebugMode;
@@ -555,8 +549,7 @@ export default class ElectronAppWrapper {
} }
// Someone tried to open a second instance - focus our window instead // Someone tried to open a second instance - focus our window instead
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied this.electronApp_.on('second-instance', (_event: Event, argv: string[], _workingDirectory: string) => {
this.electronApp_.on('second-instance', (_e: any, argv: string[]) => {
const win = this.mainWindow(); const win = this.mainWindow();
if (!win) return; if (!win) return;
if (win.isMinimized()) win.restore(); if (win.isMinimized()) win.restore();