Skip to content

Commit 4d2f516

Browse files
committed
refactor: use a boolean instead of the Lock object
1 parent 293c069 commit 4d2f516

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
@@ -226,8 +226,8 @@ export class AppState {
226226
});
227227
}
228228

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

232232
// Used to release the lock when the current window switches Electron versions
233233
private versionLockController = new AbortController();
@@ -989,7 +989,7 @@ export class AppState {
989989
return;
990990
}
991991

992-
if (this.versionLock) {
992+
if (this.hasActiveLock) {
993993
console.log(`Releasing lock on version ${this.version}`);
994994

995995
// release the lock on the previous version
@@ -1007,7 +1007,7 @@ export class AppState {
10071007
this.getVersionLockName(version),
10081008
{ mode: 'shared' },
10091009
(lock) => {
1010-
this.versionLock = lock;
1010+
this.hasActiveLock = Boolean(lock);
10111011

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

0 commit comments

Comments
 (0)