From 67652c7ace6867f69f968628d0d643055dc27ffa Mon Sep 17 00:00:00 2001 From: Samuel Imolorhe Date: Mon, 13 Nov 2017 21:53:13 +0100 Subject: [PATCH] Fixed bug in query service. --- src/app/services/query.service.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/services/query.service.ts b/src/app/services/query.service.ts index 701bfccf40..f072cda27e 100644 --- a/src/app/services/query.service.ts +++ b/src/app/services/query.service.ts @@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'; import { Store } from '@ngrx/store'; import { Observable } from 'rxjs/Observable'; +import { Subscription } from 'rxjs/Subscription'; import * as fromRoot from '../reducers'; @@ -18,7 +19,7 @@ export class QueryService { private store: Store ) { } - loadUrl(windowId): Observable { + loadUrl(windowId): Subscription { return this.db.getItem(`${windowId}:url`).subscribe(url => { if (url) { this.store.dispatch(new queryActions.SetUrlFromDbAction(url, windowId)); @@ -26,7 +27,7 @@ export class QueryService { }); } - loadQuery(windowId): Observable { + loadQuery(windowId): Subscription { return this.db.getItem(`${windowId}:query`).subscribe(query => { if (query) { this.store.dispatch(new queryActions.SetQueryFromDbAction(query, windowId)); @@ -34,7 +35,7 @@ export class QueryService { }); } - loadIntrospection(windowId): Observable { + loadIntrospection(windowId): Subscription { return this.db.getItem(`${windowId}:introspection`).subscribe(introspectionData => { if (introspectionData) { this.store.dispatch(new gqlSchemaActions.SetIntrospectionFromDbAction(introspectionData, windowId));