Loading packages/carrier-mobile-ionic/src/graphql/apollo.config.ts +10 −8 Original line number Diff line number Diff line import { NgModule } from '@angular/core'; import { HttpClientModule } from '@angular/common/http'; import { Apollo } from 'apollo-angular'; import { HttpLink, HttpLinkModule } from 'apollo-angular-link-http'; import { InMemoryCache } from '@apollo/client/core'; import { setContext } from 'apollo-link-context'; import { HttpLink, HttpLinkHandler } from 'apollo-angular/http'; import { ApolloLink, InMemoryCache } from '@apollo/client/core'; import { setContext } from '@apollo/client/link/context'; import { environment } from '../environments/environment'; @NgModule({ exports: [ HttpClientModule, HttpLinkModule HttpClientModule ], }) export class GraphQLModule { constructor(apollo: Apollo, httpLink: HttpLink) { constructor( private readonly apollo: Apollo, private readonly httpLink: HttpLink ) { const uri = environment.GQL_ENDPOINT; const http = httpLink.create({ uri }); const http: HttpLinkHandler = httpLink.create({ uri }); const authLink = setContext((_, { headers }) => { const authLink: ApolloLink = setContext((_, { headers }) => { // get the authentication token from local storage if it exists const token = localStorage.getItem('token'); // return the headers to the context so httpLink can read them Loading packages/carrier-mobile-ionic/src/pages/main/main.ts +1 −8 Original line number Diff line number Diff line import { Component, ViewChild, ElementRef, OnInit, OnDestroy, } from '@angular/core'; Loading @@ -12,8 +10,6 @@ import CarrierStatus from '@modules/server.common/enums/CarrierStatus'; import { generateObjectIdString } from '@modules/server.common/utils'; import GeoLocation from '@modules/server.common/entities/GeoLocation'; import { Store } from '../../services/store.service'; import IGeoLocation from '@modules/server.common/interfaces/IGeoLocation'; import { GeoLocationService } from '../../services/geo-location.service'; import { Platform } from '@ionic/angular'; import IOrder from '@modules/server.common/interfaces/IOrder'; import { Subject } from 'rxjs'; Loading @@ -27,9 +23,7 @@ import { takeUntil } from 'rxjs/operators'; export class MainPage implements OnInit, OnDestroy { selectedOrder: IOrder; private watch: any; private isOnline: boolean; private isMapRendered: boolean; private destroy$ = new Subject<void>(); isTakenFromAnotherCarrier: boolean = false; Loading @@ -37,7 +31,6 @@ export class MainPage implements OnInit, OnDestroy { private platform: Platform, private carrierRouter: CarrierRouter, private geolocation: Geolocation, private geoLocationService: GeoLocationService, private store: Store ) {} Loading Loading @@ -134,7 +127,7 @@ export class MainPage implements OnInit, OnDestroy { .pipe(takeUntil(this.destroy$)) .subscribe((o) => { this.isTakenFromAnotherCarrier = !!o && !!o.carrier && o.carrier !== this.store.carrierId; !!o && !!o.carrier && o.carrier.id !== this.store.carrierId; this.selectedOrder = o; }); } Loading Loading
packages/carrier-mobile-ionic/src/graphql/apollo.config.ts +10 −8 Original line number Diff line number Diff line import { NgModule } from '@angular/core'; import { HttpClientModule } from '@angular/common/http'; import { Apollo } from 'apollo-angular'; import { HttpLink, HttpLinkModule } from 'apollo-angular-link-http'; import { InMemoryCache } from '@apollo/client/core'; import { setContext } from 'apollo-link-context'; import { HttpLink, HttpLinkHandler } from 'apollo-angular/http'; import { ApolloLink, InMemoryCache } from '@apollo/client/core'; import { setContext } from '@apollo/client/link/context'; import { environment } from '../environments/environment'; @NgModule({ exports: [ HttpClientModule, HttpLinkModule HttpClientModule ], }) export class GraphQLModule { constructor(apollo: Apollo, httpLink: HttpLink) { constructor( private readonly apollo: Apollo, private readonly httpLink: HttpLink ) { const uri = environment.GQL_ENDPOINT; const http = httpLink.create({ uri }); const http: HttpLinkHandler = httpLink.create({ uri }); const authLink = setContext((_, { headers }) => { const authLink: ApolloLink = setContext((_, { headers }) => { // get the authentication token from local storage if it exists const token = localStorage.getItem('token'); // return the headers to the context so httpLink can read them Loading
packages/carrier-mobile-ionic/src/pages/main/main.ts +1 −8 Original line number Diff line number Diff line import { Component, ViewChild, ElementRef, OnInit, OnDestroy, } from '@angular/core'; Loading @@ -12,8 +10,6 @@ import CarrierStatus from '@modules/server.common/enums/CarrierStatus'; import { generateObjectIdString } from '@modules/server.common/utils'; import GeoLocation from '@modules/server.common/entities/GeoLocation'; import { Store } from '../../services/store.service'; import IGeoLocation from '@modules/server.common/interfaces/IGeoLocation'; import { GeoLocationService } from '../../services/geo-location.service'; import { Platform } from '@ionic/angular'; import IOrder from '@modules/server.common/interfaces/IOrder'; import { Subject } from 'rxjs'; Loading @@ -27,9 +23,7 @@ import { takeUntil } from 'rxjs/operators'; export class MainPage implements OnInit, OnDestroy { selectedOrder: IOrder; private watch: any; private isOnline: boolean; private isMapRendered: boolean; private destroy$ = new Subject<void>(); isTakenFromAnotherCarrier: boolean = false; Loading @@ -37,7 +31,6 @@ export class MainPage implements OnInit, OnDestroy { private platform: Platform, private carrierRouter: CarrierRouter, private geolocation: Geolocation, private geoLocationService: GeoLocationService, private store: Store ) {} Loading Loading @@ -134,7 +127,7 @@ export class MainPage implements OnInit, OnDestroy { .pipe(takeUntil(this.destroy$)) .subscribe((o) => { this.isTakenFromAnotherCarrier = !!o && !!o.carrier && o.carrier !== this.store.carrierId; !!o && !!o.carrier && o.carrier.id !== this.store.carrierId; this.selectedOrder = o; }); } Loading