mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 01:25:37 -05:00
Strict nulls for contrib/restore and contrib/views (#12044)
* strict nulls for contrib/restore and contrib/views * remove unnecessary function * compile error
This commit is contained in:
@@ -26,9 +26,11 @@ const DE_RESTORE_COMMAND_ID = 'dataExplorer.restore';
|
||||
// Restore
|
||||
CommandsRegistry.registerCommand({
|
||||
id: DE_RESTORE_COMMAND_ID,
|
||||
handler: (accessor, args: TreeViewItemHandleArg) => {
|
||||
const commandService = accessor.get(ICommandService);
|
||||
return commandService.executeCommand(RestoreAction.ID, args.$treeItem.payload);
|
||||
handler: async (accessor, args: TreeViewItemHandleArg) => {
|
||||
if (args.$treeItem?.payload) {
|
||||
const commandService = accessor.get(ICommandService);
|
||||
return commandService.executeCommand(RestoreAction.ID, args.$treeItem.payload);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -39,9 +39,10 @@ export class RestoreAction extends Task {
|
||||
});
|
||||
}
|
||||
|
||||
runTask(accessor: ServicesAccessor, profile: IConnectionProfile): void | Promise<void> {
|
||||
runTask(accessor: ServicesAccessor, withProfile?: IConnectionProfile): void | Promise<void> {
|
||||
let profile = withProfile;
|
||||
const configurationService = accessor.get<IConfigurationService>(IConfigurationService);
|
||||
const previewFeaturesEnabled: boolean = configurationService.getValue('workbench')['enablePreviewFeatures'];
|
||||
const previewFeaturesEnabled: boolean = configurationService.getValue<{ enablePreviewFeatures: boolean }>('workbench').enablePreviewFeatures;
|
||||
if (!previewFeaturesEnabled) {
|
||||
return accessor.get<INotificationService>(INotificationService).info(localize('restore.isPreviewFeature', "You must enable preview features in order to use restore"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user