mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-31 01:25:38 -05:00
Change shutdown listeners (#4282)
* change shutdown to use proper notification * change to use storage service * remove unused imports * fix test * change shutdown methods to private * remove unusde imports * fix tests * formatting
This commit is contained in:
@@ -51,7 +51,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
private _mementoObj: object,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@IStorageService private _storageService: IStorageService,
|
||||
@IClipboardService private _clipboardService: IClipboardService,
|
||||
@IClipboardService private _clipboardService: IClipboardService
|
||||
) {
|
||||
// Create the account store
|
||||
if (!this._mementoObj) {
|
||||
@@ -65,6 +65,8 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
this._removeAccountProviderEmitter = new Emitter<azdata.AccountProviderMetadata>();
|
||||
this._updateAccountListEmitter = new Emitter<UpdateAccountListEventParams>();
|
||||
|
||||
_storageService.onWillSaveState(() => this.shutdown());
|
||||
|
||||
// Register status bar item
|
||||
let statusbarDescriptor = new statusbar.StatusbarItemDescriptor(
|
||||
AccountListStatusbarItem,
|
||||
@@ -367,7 +369,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
/**
|
||||
* Handler for when shutdown of the application occurs. Writes out the memento.
|
||||
*/
|
||||
public shutdown(): void {
|
||||
private shutdown(): void {
|
||||
if (this._mementoContext) {
|
||||
this._mementoContext.saveMemento();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user