diff --git a/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts b/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts index fce0f7642a..58b627de9f 100644 --- a/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts +++ b/src/sql/workbench/contrib/profiler/browser/profilerEditor.ts @@ -553,7 +553,7 @@ export class ProfilerEditor extends EditorPane { this._profilerService.launchCreateSessionDialog(this.input); } - if (previousSessionName) { // skip updating session selector if there is no previous session name + if (!this.input.isFileSession) { // skip updating session selector for File session to block starting another session from a non-connected file session this._updateSessionSelector(previousSessionName); } } else { @@ -581,7 +581,7 @@ export class ProfilerEditor extends EditorPane { } if (this.input.state.isStopped) { this._updateToolbar(); - if (!this.input.isFileSession) { // skip updating session selector for File sessions + if (!this.input.isFileSession) { // skip updating session selector for File sessions to block starting another session from a non-connected file session this._updateSessionSelector(); } } diff --git a/src/sql/workbench/services/profiler/browser/profilerService.ts b/src/sql/workbench/services/profiler/browser/profilerService.ts index 093b738742..f6dabd5579 100644 --- a/src/sql/workbench/services/profiler/browser/profilerService.ts +++ b/src/sql/workbench/services/profiler/browser/profilerService.ts @@ -161,7 +161,7 @@ export class ProfilerService implements IProfilerService { this.updateMemento(id, { previousSessionName: sessionName }); try { await this._runAction(id, provider => provider.startSession(this._idMap.get(id)!, sessionName, sessionType)); - let isRunning = sessionType === ProfilingSessionType.RemoteSession ? true : false; // Reading session stops when the file reading completes + let isRunning = sessionType === ProfilingSessionType.LocalFile ? false : true; // Reading session stops when the file reading completes this._sessionMap.get(this._idMap.reverseGet(id)!)!.onSessionStateChanged({ isRunning: isRunning, isStopped: false, isPaused: false }); return true;