Chore: Resolves #11993: Display a message explaining why the app did not start in dev mode

This commit is contained in:
Laurent Cozic
2025-03-21 12:08:09 +01:00
parent 2142373fff
commit 808eb7d49a
2 changed files with 6 additions and 1 deletions

View File

@@ -20,7 +20,7 @@ import handleCustomProtocols, { CustomProtocolHandler } from './utils/customProt
import { clearTimeout, setTimeout } from 'timers';
import { resolve } from 'path';
import { defaultWindowId } from '@joplin/lib/reducer';
import { msleep } from '@joplin/utils/time';
import { msleep, Second } from '@joplin/utils/time';
interface RendererProcessQuitReply {
canClose: boolean;
@@ -674,6 +674,7 @@ export default class ElectronAppWrapper {
await this.sendCrossAppIpcMessage(message);
this.quit();
if (this.env() === 'dev') console.warn(`Closing the application because another instance is already running, or the previous instance was force-quit within the last ${Math.round(this.profileLocker_.options.interval / Second)} seconds.`);
return true;
}

View File

@@ -40,6 +40,10 @@ export class FileLocker {
this.filePath_ = filePath;
}
public get options() {
return this.options_;
}
public async lock() {
if (!(await this.canLock())) return false;