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 { 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 { Store } from '@ngrx/store';
|
||||||
import { State } from '../reducers/index';
|
import { State } from '../reducers/index';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
@ -16,20 +11,11 @@ import { fetchFile, sendFile } from '../actions/front-page.actions';
|
|||||||
styleUrls: ['./front-page.component.scss'],
|
styleUrls: ['./front-page.component.scss'],
|
||||||
})
|
})
|
||||||
export class FrontPageComponent implements OnInit {
|
export class FrontPageComponent implements OnInit {
|
||||||
// private file: File;
|
|
||||||
// public fileName: string;
|
|
||||||
// public isFileFetched: boolean;
|
|
||||||
file$: Observable<File>;
|
file$: Observable<File>;
|
||||||
fileName$: Observable<string>;
|
fileName$: Observable<string>;
|
||||||
isFileFetched$: Observable<boolean>;
|
isFileFetched$: Observable<boolean>;
|
||||||
|
|
||||||
constructor(
|
constructor(private store: Store<State>) {}
|
||||||
private sendDataService: SendDataService,
|
|
||||||
private sharedDataService: SharedDataService,
|
|
||||||
private router: Router,
|
|
||||||
private toastService: NbToastrService,
|
|
||||||
private store: Store<State>
|
|
||||||
) {}
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.file$ = this.store.select(Selectors.selectFile);
|
this.file$ = this.store.select(Selectors.selectFile);
|
||||||
@ -56,18 +42,5 @@ export class FrontPageComponent implements OnInit {
|
|||||||
|
|
||||||
sendFile(event: any): void {
|
sendFile(event: any): void {
|
||||||
this.store.dispatch({ type: '[FrontPage Component] Send File' });
|
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