Skip to content

Commit 6e6c27e

Browse files
committed
refactor: use a boolean instead of the Lock object
1 parent d70f7f9 commit 6e6c27e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/renderer/state.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ export class AppState {
225225
});
226226
}
227227

228-
// Lock on the active Electron version that prevents other windows from removing it
229-
private versionLock: Lock | null = null;
228+
// Do we have a lock on the active Electron version that prevents other windows from removing it?
229+
private hasActiveLock = false;
230230

231231
// Used to release the lock when the current window switches Electron versions
232232
private versionLockController = new AbortController();
@@ -984,7 +984,7 @@ export class AppState {
984984
return;
985985
}
986986

987-
if (this.versionLock) {
987+
if (this.hasActiveLock) {
988988
console.log(`Releasing lock on version ${this.version}`);
989989

990990
// release the lock on the previous version
@@ -1002,7 +1002,7 @@ export class AppState {
10021002
this.getVersionLockName(version),
10031003
{ mode: 'shared' },
10041004
(lock) => {
1005-
this.versionLock = lock;
1005+
this.hasActiveLock = Boolean(lock);
10061006

10071007
/**
10081008
* The lock is released when this promise resolves, so we keep it in the

0 commit comments

Comments
 (0)