Handled some more subscriptions

parent 7fb4b3d2
......@@ -104,10 +104,6 @@ import { ReportsSchema, TableColumn } from "./reports-schema";
this.loginInfoSub.unsubscribe();
if (this.generalReportSub)
this.generalReportSub.unsubscribe();
if (this.loginInfo$)
this.loginInfo$.unsubscribe();
if (this.generalReport$)
this.generalReport$.unsubscribe();
}
createReport() {
......
......@@ -60,6 +60,7 @@ export default class SchoolHome implements OnInit, OnDestroy {
private xcsrftoken: any;
private loginInfo$: BehaviorSubject<ILoginInfoRecords>;
private loginInfoSub: Subscription;
private queryParamSub: Subscription;
private apiEndPoint = API_ENDPOINT;
private apiEndPointParams = API_ENDPOINT_PARAMS;
......@@ -83,8 +84,8 @@ export default class SchoolHome implements OnInit, OnDestroy {
ngOnDestroy() {
if (this.loginInfoSub)
this.loginInfoSub.unsubscribe();
this.loginInfo$.unsubscribe();
this.errorCode$.unsubscribe();
if (this.queryParamSub)
this.queryParamSub.unsubscribe();
};
ngOnInit() {
......@@ -112,7 +113,7 @@ export default class SchoolHome implements OnInit, OnDestroy {
});
// subscribe to router event
this.activatedRoute.queryParams.subscribe((params: Params) => {
this.queryParamSub = this.activatedRoute.queryParams.subscribe((params: Params) => {
if (params) {
this.authToken = params["auth_token"];
this.authRole = params["auth_role"];
......
......@@ -188,7 +188,7 @@ import { IAppState } from "../../store/store";
}
ngOnDestroy() {
if (this.loginInfo$) this.loginInfo$.unsubscribe();
if (this.loginInfoSub) this.loginInfoSub.unsubscribe();
}
ngOnInit() {
......
......@@ -268,8 +268,6 @@ import { IAppState } from "../../store/store";
this.SubmitedUsersSub.unsubscribe();
if (this.SubmitedDetailsSub)
this.SubmitedDetailsSub.unsubscribe();
this.SubmitedDetails$.unsubscribe();
this.SubmitedApplic$.unsubscribe();
}
ngOnInit() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment