Skip to content

Commit e826c50

Browse files
committed
chore: removing call to app.quit when initailizing the app
Signed-off-by: Pawel Psztyc <[email protected]>
1 parent 8a654c4 commit e826c50

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/io/TelemetryConsent.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-param-reassign */
22
import fs from 'fs-extra';
33
import path from 'path';
4-
import { ipcMain, app, shell } from 'electron';
4+
import { ipcMain, shell } from 'electron';
55

66
/** @typedef {import('./WindowsManager').WindowsManager} WindowsManager */
77

@@ -60,8 +60,7 @@ export class TelemetryConsent {
6060
}
6161

6262
async pageHandler() {
63-
await fs.ensureFile(this.lockFile);
64-
app.relaunch();
65-
app.quit();
63+
await fs.writeFile(this.lockFile, 'Do not remove this file. It prohibits showing the analytics dialog.');
64+
this.resolve();
6665
}
6766
}

src/io/defaults/DataStore.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class DataStore {
2626
this._reportedReady = this._reportedReady.bind(this);
2727
this._receiverReady = this._receiverReady.bind(this);
2828
this._errorHandler = this._errorHandler.bind(this);
29-
this.lockFile = path.join(process.env.ARC_HOME, '.db-moved-hostname');
29+
this.lockFile = path.join(process.env.ARC_HOME, '.db-moved-hostname.lock');
3030
this.migrationExport = path.join(app.getPath('temp'), '.migrate-data');
3131
ipcMain.on('server-db-no-data', this._noDataHandler);
3232
ipcMain.on('server-db-finished', this._serverDataHandler);
@@ -170,12 +170,11 @@ export class DataStore {
170170
ipcMain.removeAllListeners('data-receiver-ready');
171171
ipcMain.removeAllListeners('db-error');
172172

173-
await fs.ensureFile(this.lockFile);
173+
await fs.writeFile(this.lockFile, 'Do not remove this file. Removing it may cause inconsistency in the data store.');
174174
const tmpExists = await fs.pathExists(this.migrationExport);
175175
if (tmpExists) {
176176
await fs.remove(this.migrationExport);
177177
}
178-
app.relaunch();
179-
app.quit();
178+
this.resolve();
180179
}
181180
}

0 commit comments

Comments
 (0)