File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable no-param-reassign */
2
2
import fs from 'fs-extra' ;
3
3
import path from 'path' ;
4
- import { ipcMain , app , shell } from 'electron' ;
4
+ import { ipcMain , shell } from 'electron' ;
5
5
6
6
/** @typedef {import('./WindowsManager').WindowsManager } WindowsManager */
7
7
@@ -60,8 +60,7 @@ export class TelemetryConsent {
60
60
}
61
61
62
62
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 ( ) ;
66
65
}
67
66
}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export class DataStore {
26
26
this . _reportedReady = this . _reportedReady . bind ( this ) ;
27
27
this . _receiverReady = this . _receiverReady . bind ( this ) ;
28
28
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 ' ) ;
30
30
this . migrationExport = path . join ( app . getPath ( 'temp' ) , '.migrate-data' ) ;
31
31
ipcMain . on ( 'server-db-no-data' , this . _noDataHandler ) ;
32
32
ipcMain . on ( 'server-db-finished' , this . _serverDataHandler ) ;
@@ -170,12 +170,11 @@ export class DataStore {
170
170
ipcMain . removeAllListeners ( 'data-receiver-ready' ) ;
171
171
ipcMain . removeAllListeners ( 'db-error' ) ;
172
172
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.' ) ;
174
174
const tmpExists = await fs . pathExists ( this . migrationExport ) ;
175
175
if ( tmpExists ) {
176
176
await fs . remove ( this . migrationExport ) ;
177
177
}
178
- app . relaunch ( ) ;
179
- app . quit ( ) ;
178
+ this . resolve ( ) ;
180
179
}
181
180
}
You can’t perform that action at this time.
0 commit comments