Skip to content

Commit 705e987

Browse files
sjburweb-flow
authored andcommitted
fix: fix tests
1 parent aa05b9d commit 705e987

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

packages/devextreme/js/__internal/scheduler/view_model/m_appointment_data_source.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface UpdatedAppointmentKey {
1818
export class AppointmentDataSource {
1919
protected updatedAppointmentKeys: UpdatedAppointmentKey[] = [];
2020

21-
protected dataSource!: DataSource;
21+
protected dataSource?: DataSource;
2222

2323
protected updatedAppointment: SafeAppointment | null = null;
2424

@@ -28,7 +28,7 @@ export class AppointmentDataSource {
2828
}
2929

3030
get keyName(): string {
31-
const store = this.dataSource.store();
31+
const store = this.dataSource?.store();
3232
return store?.key() as string;
3333
}
3434

@@ -37,7 +37,7 @@ export class AppointmentDataSource {
3737
}
3838

3939
private getStoreKey(target: SafeAppointment): unknown {
40-
const store = this.dataSource.store();
40+
const store = this.dataSource?.store();
4141

4242
return store?.keyOf(target);
4343
}
@@ -51,9 +51,9 @@ export class AppointmentDataSource {
5151

5252
private initStoreChangeHandlers(): void {
5353
const { dataSource } = this;
54-
const store = dataSource.store();
54+
const store = dataSource?.store();
5555

56-
if (store) {
56+
if (dataSource && store) {
5757
store.on(STORE_EVENTS.updating, (key) => {
5858
const keyName = store.key() as string;
5959
if (keyName) {
@@ -107,7 +107,7 @@ export class AppointmentDataSource {
107107

108108
add(rawAppointment: SafeAppointment): DeferredObj<SafeAppointment> {
109109
// @eslint-disable-next-line
110-
return this.dataSource.store().insert(rawAppointment)
110+
return this.dataSource!.store().insert(rawAppointment)
111111
// @ts-expect-error
112112
.done(() => this.dataSource.load());
113113
}
@@ -117,7 +117,7 @@ export class AppointmentDataSource {
117117
// @ts-expect-error
118118
const d = new Deferred();
119119

120-
this.dataSource.store().update(key, data)
120+
this.dataSource!.store().update(key, data)
121121
// @ts-expect-error
122122
.done((result) => this.dataSource.load()
123123
// @ts-expect-error
@@ -130,13 +130,13 @@ export class AppointmentDataSource {
130130

131131
remove(rawAppointment: SafeAppointment): DeferredObj<SafeAppointment | undefined> {
132132
const key = this.getStoreKey(rawAppointment);
133-
return this.dataSource.store().remove(key)
133+
return this.dataSource!.store().remove(key)
134134
// @ts-expect-error
135135
.done(() => this.dataSource.load());
136136
}
137137

138138
destroy(): void {
139-
const store = this.dataSource.store();
139+
const store = this.dataSource?.store();
140140

141141
if (store) {
142142
store.off(STORE_EVENTS.updating);

0 commit comments

Comments
 (0)