Skip to content

Commit 4398a4e

Browse files
committed
refactor: use a boolean instead of the Lock object
1 parent aeff8d2 commit 4398a4e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/renderer/state.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ export class AppState {
207207
versions: this.baseVersions,
208208
});
209209

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

213213
// Used to release the lock when the current window switches Electron versions
214214
private versionLockController = new AbortController();
@@ -881,7 +881,7 @@ export class AppState {
881881
return;
882882
}
883883

884-
if (this.versionLock) {
884+
if (this.hasActiveLock) {
885885
console.log(`Releasing lock on version ${this.version}`);
886886

887887
// release the lock on the previous version
@@ -899,7 +899,7 @@ export class AppState {
899899
this.getVersionLockName(version),
900900
{ mode: 'shared' },
901901
(lock) => {
902-
this.versionLock = lock;
902+
this.hasActiveLock = Boolean(lock);
903903

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

0 commit comments

Comments
 (0)