Skip to content

Commit

Permalink
Fix #31
Browse files Browse the repository at this point in the history
  • Loading branch information
salah3x committed Jul 30, 2019
1 parent 988c75b commit 416afd5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import { Component } from '@angular/core';

import { Platform } from '@ionic/angular';
import { Plugins, Capacitor } from '@capacitor/core';
import { StoreService } from './shared/store.service';

@Component({
selector: 'app-root',
templateUrl: 'app.component.html'
})
export class AppComponent {
constructor(private platform: Platform, private store: StoreService) {
constructor(private platform: Platform) {
this.initializeApp();
}

Expand All @@ -19,6 +18,5 @@ export class AppComponent {
Plugins.SplashScreen.hide();
}
});
this.store.shareMyLocation();
}
}
4 changes: 2 additions & 2 deletions src/app/shared/store.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,14 @@ export class StoreService {
tap(() => {
this.subs.unsubscribe();
if (sharing) {
this.shareMyLocation();
this.startSharingMyLocation();
}
})
)
.toPromise();
}

shareMyLocation(): void {
startSharingMyLocation(): void {
this.subs = this.getUser()
.pipe(
switchMap(user =>
Expand Down
12 changes: 9 additions & 3 deletions src/app/tabs/tabs.page.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';

import { StoreService } from '../shared/store.service';

@Component({
selector: 'app-tabs',
templateUrl: 'tabs.page.html',
styleUrls: ['tabs.page.scss']
})
export class TabsPage {
constructor() {}
export class TabsPage implements OnInit {
constructor(private store: StoreService) {}

ngOnInit() {
this.store.startSharingMyLocation();
}
}

0 comments on commit 416afd5

Please sign in to comment.