Fixes bug when opening the scheduler dialog (#6624)

Checks if the loading component is loaded before using it
This commit is contained in:
Amir Omidi
2019-08-14 10:51:06 -07:00
committed by GitHub
parent 5528a90eaf
commit 462b5d1d53
2 changed files with 11 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ export class PickScheduleData implements IAgentDialogData {
public schedules: azdata.AgentJobScheduleInfo[];
public selectedSchedule: azdata.AgentJobScheduleInfo;
private jobName: string;
private initialized: boolean;
constructor(ownerUri: string, jobName: string) {
this.ownerUri = ownerUri;
@@ -24,6 +25,7 @@ export class PickScheduleData implements IAgentDialogData {
let agentService = await AgentUtils.getAgentService();
try {
let result = await agentService.getJobSchedules(this.ownerUri);
this.initialized = true;
if (result && result.success) {
this.schedules = result.schedules;
return this.schedules;
@@ -36,4 +38,8 @@ export class PickScheduleData implements IAgentDialogData {
public async save() {
this.selectedSchedule.jobName = this.jobName;
}
public isInitialized() {
return this.initialized;
}
}