Skip to content

Commit

Permalink
fix(datepicker): updated subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
SvetlanaMuravlova committed Jan 11, 2022
1 parent bccc1d7 commit b5db1c4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/datepicker/bs-datepicker-inline.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ export class BsDatepickerInlineDirective implements OnInit, OnDestroy, OnChanges
unsubscribeSubscriptions() {
if (this._subs?.length) {
this._subs.map(sub => sub.unsubscribe());
this._subs.length = 0;
}
this._subs = [];
}

ngOnChanges(changes: SimpleChanges): void {
Expand Down
1 change: 1 addition & 0 deletions src/datepicker/bs-datepicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ export class BsDatepickerDirective implements OnInit, OnDestroy, OnChanges, Afte
unsubscribeSubscriptions() {
if (this._subs?.length) {
this._subs.map(sub => sub.unsubscribe());
this._subs.length = 0;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/datepicker/bs-daterangepicker-inline.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ export class BsDaterangepickerInlineDirective implements OnInit, OnDestroy, OnCh
unsubscribeSubscriptions() {
if (this._subs?.length) {
this._subs.map(sub => sub.unsubscribe());
this._subs.length = 0;
}
this._subs = [];
}

ngOnDestroy() {
Expand Down
1 change: 1 addition & 0 deletions src/datepicker/bs-daterangepicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ export class BsDaterangepickerDirective
unsubscribeSubscriptions() {
if (this._subs?.length) {
this._subs.map(sub => sub.unsubscribe());
this._subs.length = 0;
}
}

Expand Down

0 comments on commit b5db1c4

Please sign in to comment.