use window.openedWorkspace (#159942)

This commit is contained in:
Sandeep Somavarapu 2022-09-03 06:32:40 +02:00 committed by GitHub
parent 6af6f489b9
commit 4f69cdf95a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 6 deletions

View file

@ -18,7 +18,7 @@ export class UserDataTransientProfilesHandler extends Disposable {
super();
this._register(lifecycleMainService.onWillLoadWindow(e => {
if (e.reason === LoadReason.LOAD) {
this.unsetTransientProfileForWorkspace(e.window.previousWorkspace ?? 'empty-window');
this.unsetTransientProfileForWorkspace(e.window.openedWorkspace ?? 'empty-window');
}
}));
this._register(lifecycleMainService.onBeforeCloseWindow(window => this.unsetTransientProfileForWorkspace(window.openedWorkspace ?? 'empty-window')));

View file

@ -27,7 +27,6 @@ export interface ICodeWindow extends IDisposable {
readonly win: BrowserWindow | null; /* `null` after being disposed */
readonly config: INativeWindowConfiguration | undefined;
readonly previousWorkspace?: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier;
readonly openedWorkspace?: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier;
readonly profile?: IUserDataProfile;

View file

@ -119,8 +119,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
get backupPath(): string | undefined { return this._config?.backupPath; }
private _previousWorkspace: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | undefined;
get previousWorkspace(): IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | undefined { return this._previousWorkspace; }
get openedWorkspace(): IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | undefined { return this._config?.workspace; }
get profile(): IUserDataProfile | undefined { return this.config ? this.userDataProfilesService.getOrSetProfileForWorkspace(this.config.workspace ?? 'empty-window', this.userDataProfilesService.profiles.find(profile => profile.id === this.config?.profiles.profile.id) ?? this.userDataProfilesService.defaultProfile) : undefined; }
@ -854,8 +852,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
this._win.setTitle(this.productService.nameLong);
}
this._previousWorkspace = this.openedWorkspace;
// Update configuration values based on our window context
// and set it into the config object URL for usage.
this.updateConfiguration(configuration, options);