notifications - do not dispose actions unless created within

This commit is contained in:
Benjamin Pasero
2018-03-16 17:24:10 +01:00
parent 5710ce949b
commit 94b502c1d6
9 changed files with 79 additions and 65 deletions

View File

@@ -15,6 +15,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
import { once } from 'vs/base/common/event';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { dispose } from 'vs/base/common/lifecycle';
@extHostNamedCustomer(MainContext.MainThreadMessageService)
export class MainThreadMessageService implements MainThreadMessageServiceShape {
@@ -92,6 +93,7 @@ export class MainThreadMessageService implements MainThreadMessageServiceShape {
// if promise has not been resolved yet, now is the time to ensure a return value
// otherwise if already resolved it means the user clicked one of the buttons
once(messageHandle.onDidDispose)(() => {
dispose(...primaryActions, ...secondaryActions);
resolve(undefined);
});
});