Only focus database panel on successful download

This commit is contained in:
Emil Hessman
2020-07-23 19:44:36 +02:00
parent 0d2b44cdba
commit e4ff8d1fa8

View File

@@ -54,12 +54,10 @@ export async function promptImportInternetDatabase(
progress
))
);
commands.executeCommand('codeQLDatabases.focus');
}
if (item) {
showAndLogInformationMessage(
'Database downloaded and imported successfully.'
);
if (item) {
commands.executeCommand('codeQLDatabases.focus');
showAndLogInformationMessage('Database downloaded and imported successfully.');
}
}
} catch (e) {
showAndLogErrorMessage(e.message);
@@ -108,16 +106,14 @@ export async function promptImportLgtmDatabase(
progress
))
);
commands.executeCommand('codeQLDatabases.focus');
if (item) {
commands.executeCommand('codeQLDatabases.focus');
showAndLogInformationMessage('Database downloaded and imported successfully.');
}
}
} else {
throw new Error(`Invalid LGTM URL: ${lgtmUrl}`);
}
if (item) {
showAndLogInformationMessage(
'Database downloaded and imported successfully.'
);
}
} catch (e) {
showAndLogErrorMessage(e.message);
}
@@ -154,12 +150,9 @@ export async function importArchiveDatabase(
progress
))
);
commands.executeCommand('codeQLDatabases.focus');
if (item) {
showAndLogInformationMessage(
'Database unzipped and imported successfully.'
);
commands.executeCommand('codeQLDatabases.focus');
showAndLogInformationMessage('Database unzipped and imported successfully.');
}
} catch (e) {
if (e.message.includes('unexpected end of file')) {