Dont show dowload buttons if using electron already

This commit is contained in:
2018-07-10 18:34:35 -04:00
parent f11ca9c27a
commit 6f22e9aa58
5 changed files with 10 additions and 2 deletions

View File

@ -13,6 +13,7 @@ import {AngularMaterialModule} from './material.module';
import {HomeComponent} from './home/home.component';
import {ServiceWorkerModule} from '@angular/service-worker';
import {FormulaManagerComponent} from './formulaManager/formulaManager.component';
import {NgxElectronModule} from 'ngx-electron';
@NgModule({
declarations: [AppComponent, ConvertFromGPipe, ConvertToGPipe, FormulaManagerComponent, HomeComponent, ScalePipe],
@ -23,6 +24,7 @@ import {FormulaManagerComponent} from './formulaManager/formulaManager.component
BrowserAnimationsModule,
BrowserModule,
FormsModule,
NgxElectronModule,
ReactiveFormsModule,
RouterModule.forRoot([
{path: 'formulaManager', component: FormulaManagerComponent},

View File

@ -1,5 +1,5 @@
<div class="container-fluid">
<div class="jumbotron mt-3">
<div *ngIf="!electron.isElectronApp" class="jumbotron mt-3">
<h1 class="display-4">Standalone</h1>
<p class="lead">Download Formula Manager 2.0</p>
<hr class="my-4">

View File

@ -1,6 +1,7 @@
import {Component, ElementRef, ViewChildren, HostListener} from '@angular/core';
import {AngularFirestore} from 'angularfire2/firestore';
import {ConvertFromGPipe, ConvertToGPipe} from './units.pipe';
import {ElectronService} from 'ngx-electron';
@Component({
selector: 'formula-manager',
@ -23,7 +24,7 @@ export class FormulaManagerComponent {
this._newTotal = new ConvertToGPipe().transform(total, this.unit);
}
constructor(private db: AngularFirestore) {
constructor(private db: AngularFirestore, public electron: ElectronService) {
this.db.firestore.enablePersistence();
this.formulas = this.db.collection('formulas').valueChanges();
}