mirror of
https://github.com/laurent22/joplin.git
synced 2026-01-30 19:30:08 -06:00
Chore: Resolves #11993: Display a message explaining why the app did not start in dev mode
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user