Upgrade Electron to 28.1.5

Co-authored-by: Fedor Indutny <238531+indutny@users.noreply.github.com>
This commit is contained in:
Fedor Indutny 2024-01-23 16:11:12 -08:00 committed by GitHub
parent d97aa68716
commit 2bc0e4755c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 421 additions and 296 deletions

View file

@ -16,6 +16,9 @@
* Most notably, if something is queued and the function is called again, we discard the
* previously queued task completely.
*/
import { drop } from './drop';
export class LatestQueue {
private isRunning: boolean;
@ -40,23 +43,25 @@ export class LatestQueue {
this.queuedTask = task;
} else {
this.isRunning = true;
task().finally(() => {
this.isRunning = false;
drop(
task().finally(() => {
this.isRunning = false;
const { queuedTask } = this;
if (queuedTask) {
this.queuedTask = undefined;
this.add(queuedTask);
} else {
try {
this.onceEmptyCallbacks.forEach(callback => {
callback();
});
} finally {
this.onceEmptyCallbacks = [];
const { queuedTask } = this;
if (queuedTask) {
this.queuedTask = undefined;
this.add(queuedTask);
} else {
try {
this.onceEmptyCallbacks.forEach(callback => {
callback();
});
} finally {
this.onceEmptyCallbacks = [];
}
}
}
});
})
);
}
}