提交 3764d68e 编写于 作者: B Benjamin Pasero

fix #93029

上级 1d9a68c7
......@@ -380,11 +380,25 @@ export class ProgressService extends Disposable implements IProgressService {
const listener = progressStateModel.onDidReport(step => updateNotification(step));
Event.once(progressStateModel.onDispose)(() => listener.dispose());
// Show progress for at least 800ms and then hide once done or canceled
Promise.all([timeout(800), progressStateModel.promise]).finally(() => {
clearTimeout(notificationTimeout);
notificationHandle?.close();
});
// Clean up eventually
(async () => {
try {
// with a delay we only wait for the finish of the promise
if (typeof options.delay === 'number' && options.delay > 0) {
await progressStateModel.promise;
}
// without a delay we show the notification for at least 800ms
// to reduce the chance of the notification flashing up and hiding
else {
await Promise.all([timeout(800), progressStateModel.promise]);
}
} finally {
clearTimeout(notificationTimeout);
notificationHandle?.close();
}
})();
return progressStateModel.promise;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册