mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 11:01:37 -05:00
fix restart ADS warning showing twice for create project from db (#17214)
This commit is contained in:
@@ -1128,10 +1128,6 @@ export class ProjectsController {
|
||||
|
||||
public async createProjectFromDatabaseCallback(model: ImportDataModel) {
|
||||
try {
|
||||
const workspaceApi = utils.getDataWorkspaceExtensionApi();
|
||||
|
||||
const validateWorkspace = await workspaceApi.validateWorkspace();
|
||||
if (validateWorkspace) {
|
||||
const newProjFolderUri = model.filePath;
|
||||
|
||||
const newProjFilePath = await this.createNewProject({
|
||||
@@ -1150,9 +1146,9 @@ export class ProjectsController {
|
||||
await project.addToProject(fileFolderList); // Add generated file structure to the project
|
||||
|
||||
// add project to workspace
|
||||
const workspaceApi = utils.getDataWorkspaceExtensionApi();
|
||||
workspaceApi.showProjectsView();
|
||||
await workspaceApi.addProjectsToWorkspace([vscode.Uri.file(newProjFilePath)]);
|
||||
}
|
||||
} catch (err) {
|
||||
void vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
}
|
||||
|
||||
@@ -372,9 +372,6 @@ export class CreateProjectFromDatabaseDialog {
|
||||
|
||||
async validate(): Promise<boolean> {
|
||||
try {
|
||||
if (await getDataWorkspaceExtensionApi().validateWorkspace() === false) {
|
||||
return false;
|
||||
}
|
||||
// the selected location should be an existing directory
|
||||
const parentDirectoryExists = await exists(this.projectLocationTextBox!.value!);
|
||||
if (!parentDirectoryExists) {
|
||||
@@ -388,6 +385,11 @@ export class CreateProjectFromDatabaseDialog {
|
||||
this.showErrorMessage(constants.ProjectDirectoryAlreadyExistError(this.projectNameTextBox!.value!, this.projectLocationTextBox!.value!));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (await getDataWorkspaceExtensionApi().validateWorkspace() === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (err) {
|
||||
this.showErrorMessage(err?.message ? err.message : err);
|
||||
|
||||
Reference in New Issue
Block a user