Front page component code cleanup
This commit is contained in:
parent
4ffda135a3
commit
a008e0d120
@ -1,9 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { SendDataService } from '../_services/send-data.service';
|
||||
import { SharedDataService } from '../_services/shared-data.service';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { NbToastrService } from '@nebular/theme';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { State } from '../reducers/index';
|
||||
import { Observable } from 'rxjs';
|
||||
@ -16,20 +11,11 @@ import { fetchFile, sendFile } from '../actions/front-page.actions';
|
||||
styleUrls: ['./front-page.component.scss'],
|
||||
})
|
||||
export class FrontPageComponent implements OnInit {
|
||||
// private file: File;
|
||||
// public fileName: string;
|
||||
// public isFileFetched: boolean;
|
||||
file$: Observable<File>;
|
||||
fileName$: Observable<string>;
|
||||
isFileFetched$: Observable<boolean>;
|
||||
|
||||
constructor(
|
||||
private sendDataService: SendDataService,
|
||||
private sharedDataService: SharedDataService,
|
||||
private router: Router,
|
||||
private toastService: NbToastrService,
|
||||
private store: Store<State>
|
||||
) {}
|
||||
constructor(private store: Store<State>) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.file$ = this.store.select(Selectors.selectFile);
|
||||
@ -56,18 +42,5 @@ export class FrontPageComponent implements OnInit {
|
||||
|
||||
sendFile(event: any): void {
|
||||
this.store.dispatch({ type: '[FrontPage Component] Send File' });
|
||||
// this.sendDataService.postFile(this.file).subscribe(
|
||||
// (res: any) => {
|
||||
// this.sharedDataService.setData(res);
|
||||
// this.router.navigate(['/view']);
|
||||
// },
|
||||
// (error: HttpErrorResponse) => {
|
||||
// if (error.status === 406) {
|
||||
// this.toastService.danger('', 'Format pliku jest niepoprawny!', {
|
||||
// icon: 'alert-circle',
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user