Update SW cache
This commit is contained in:
parent
6565178ecd
commit
538c585cc1
@ -7,6 +7,7 @@ import {LoginComponent} from './login/login.component';
|
||||
import { LocalStorage } from 'webstorage-decorators';
|
||||
import { AppStore } from './app.store';
|
||||
import { AngularFireAuth } from '../../node_modules/angularfire2/auth';
|
||||
import { SwUpdate } from '../../node_modules/@angular/service-worker';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
@ -19,10 +20,15 @@ export class AppComponent implements OnInit {
|
||||
constructor(
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private updates: SwUpdate,
|
||||
public electron: ElectronService,
|
||||
public store: AppStore,
|
||||
public afAuth: AngularFireAuth
|
||||
) {}
|
||||
) {
|
||||
updates.available.subscribe(event => {
|
||||
if (event.current != event.available) updates.activateUpdate().then(() => document.location.reload());
|
||||
});
|
||||
}
|
||||
|
||||
cartAdd(id: string, item: string, price: number, currency: 'CAD' | 'USD', quantity: number) {
|
||||
this.cart = [{ id: id, item: item, price: Number(price), currency: currency, quantity: Number(quantity) }].concat(
|
||||
|
@ -72,7 +72,7 @@ import {SlideshowModule} from 'ng-simple-slideshow';
|
||||
{ path: 'store', component: CategoriesComponent },
|
||||
{ path: '**', component: HomeComponent }
|
||||
]),
|
||||
ServiceWorkerModule.register('/ngsw-worker.js', {enabled: false}),
|
||||
ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production }),
|
||||
SlideshowModule
|
||||
],
|
||||
providers: [AppStore],
|
||||
|
Loading…
Reference in New Issue
Block a user