Dont show dowload buttons if using electron already

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

View File

@ -32,6 +32,7 @@
"firebase": "^5.1.0",
"firebase-tools": "^3.19.0",
"hammerjs": "^2.0.8",
"ngx-electron": "^1.0.4",
"rxjs": "^6.0.0",
"zone.js": "^0.8.26"
},

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();
}

View File

@ -5454,6 +5454,10 @@ next-tick@1:
version "1.0.0"
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c"
ngx-electron@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/ngx-electron/-/ngx-electron-1.0.4.tgz#2d80b25d74ae4d6226ad8b3bc4ecfa611e48fdca"
nice-try@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4"