Fix Altair save button in the interactive window (#151389)

Altair save as button doesn't work in the interactive window
Fixes #150323
pull/151389/merge
Rob Lourens 2022-06-07 14:17:21 -07:00 committed by GitHub
parent 9545af80f6
commit da6e512e13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,6 @@ import { preloadsScriptStr, RendererMetadata } from 'vs/workbench/contrib/notebo
import { transformWebviewThemeVars } from 'vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping';
import { MarkupCellViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel';
import { CellUri, INotebookRendererInfo, NotebookSetting, RendererMessagingSpec } from 'vs/workbench/contrib/notebook/common/notebookCommon';
import { INotebookExecutionStateService } from 'vs/workbench/contrib/notebook/common/notebookExecutionStateService';
import { INotebookKernel } from 'vs/workbench/contrib/notebook/common/notebookKernelService';
import { IScopedRendererMessaging } from 'vs/workbench/contrib/notebook/common/notebookRendererMessagingService';
import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService';
@ -136,7 +135,6 @@ export class BackLayerWebView<T extends ICommonCellInfo> extends Disposable {
@ILanguageService private readonly languageService: ILanguageService,
@IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
@INotebookExecutionStateService notebookExecutionStateService: INotebookExecutionStateService
) {
super();
@ -859,7 +857,9 @@ var requirejs = (function() {
return;
}
const defaultDir = dirname(this.documentUri);
const defaultDir = this.documentUri.scheme === Schemas.vscodeInteractive ?
this.workspaceContextService.getWorkspace().folders[0]?.uri ?? await this.fileDialogService.defaultFilePath() :
dirname(this.documentUri);
let defaultName: string;
if (event.downloadName) {
defaultName = event.downloadName;