convert unmutated lets to consts
This commit is contained in:
parent
6909fb3851
commit
a7cab6d0dc
3 changed files with 15 additions and 23 deletions
|
|
@ -8,10 +8,10 @@ import { FormsModule } from '@angular/forms';
|
|||
import { NgClass } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-add-new-torrent',
|
||||
templateUrl: './add-new-torrent.component.html',
|
||||
styleUrls: ['./add-new-torrent.component.scss'],
|
||||
imports: [FormsModule, NgClass],
|
||||
selector: 'app-add-new-torrent',
|
||||
templateUrl: './add-new-torrent.component.html',
|
||||
styleUrls: ['./add-new-torrent.component.scss'],
|
||||
imports: [FormsModule, NgClass],
|
||||
})
|
||||
export class AddNewTorrentComponent implements OnInit {
|
||||
public fileName: string;
|
||||
|
|
@ -51,11 +51,11 @@ export class AddNewTorrentComponent implements OnInit {
|
|||
private router: Router,
|
||||
private torrentService: TorrentService,
|
||||
private settingsService: SettingsService,
|
||||
private activatedRoute: ActivatedRoute
|
||||
private activatedRoute: ActivatedRoute,
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
this.activatedRoute.queryParams.subscribe((params) => {
|
||||
if (params['magnet']) {
|
||||
this.magnetLink = decodeURIComponent(params['magnet']);
|
||||
}
|
||||
|
|
@ -118,7 +118,7 @@ export class AddNewTorrentComponent implements OnInit {
|
|||
|
||||
if (this.downloadAction === 2) {
|
||||
const selectedFiles = [];
|
||||
for (let filePath in this.downloadFiles) {
|
||||
for (const filePath in this.downloadFiles) {
|
||||
if (this.downloadFiles[filePath] === true) {
|
||||
selectedFiles.push(filePath);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export class TorrentStatusPipe implements PipeTransform {
|
|||
const bytesTotal = downloading.reduce((sum, m) => sum + m.bytesTotal, 0);
|
||||
const progress = (bytesDone / bytesTotal || 0) * 100;
|
||||
|
||||
let allSpeeds = downloading.reduce((sum, m) => sum + m.speed, 0);
|
||||
const allSpeeds = downloading.reduce((sum, m) => sum + m.speed, 0);
|
||||
|
||||
const speed: string | string[] = this.pipe.transform(allSpeeds, 'filesize');
|
||||
|
||||
|
|
|
|||
|
|
@ -10,18 +10,10 @@ import { SortPipe } from '../sort.pipe';
|
|||
import { FileSizePipe } from '../filesize.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-torrent-table',
|
||||
templateUrl: './torrent-table.component.html',
|
||||
styleUrls: ['./torrent-table.component.scss'],
|
||||
imports: [
|
||||
FormsModule,
|
||||
NgClass,
|
||||
DecimalPipe,
|
||||
DatePipe,
|
||||
TorrentStatusPipe,
|
||||
SortPipe,
|
||||
FileSizePipe,
|
||||
],
|
||||
selector: 'app-torrent-table',
|
||||
templateUrl: './torrent-table.component.html',
|
||||
styleUrls: ['./torrent-table.component.scss'],
|
||||
imports: [FormsModule, NgClass, DecimalPipe, DatePipe, TorrentStatusPipe, SortPipe, FileSizePipe],
|
||||
})
|
||||
export class TorrentTableComponent implements OnInit {
|
||||
public torrents: Torrent[] = [];
|
||||
|
|
@ -120,7 +112,7 @@ export class TorrentTableComponent implements OnInit {
|
|||
public deleteOk(): void {
|
||||
this.deleting = true;
|
||||
|
||||
let calls: Observable<void>[] = [];
|
||||
const calls: Observable<void>[] = [];
|
||||
|
||||
this.selectedTorrents.forEach((torrentId) => {
|
||||
calls.push(this.torrentService.delete(torrentId, this.deleteData, this.deleteRdTorrent, this.deleteLocalFiles));
|
||||
|
|
@ -153,7 +145,7 @@ export class TorrentTableComponent implements OnInit {
|
|||
public retryOk(): void {
|
||||
this.retrying = true;
|
||||
|
||||
let calls: Observable<void>[] = [];
|
||||
const calls: Observable<void>[] = [];
|
||||
|
||||
this.selectedTorrents.forEach((torrentId) => {
|
||||
calls.push(this.torrentService.retry(torrentId));
|
||||
|
|
@ -221,7 +213,7 @@ export class TorrentTableComponent implements OnInit {
|
|||
public changeSettingsOk(): void {
|
||||
this.changingSettings = true;
|
||||
|
||||
let calls: Observable<void>[] = [];
|
||||
const calls: Observable<void>[] = [];
|
||||
|
||||
const selectedTorrents = this.torrents.filter((m) => this.selectedTorrents.indexOf(m.torrentId) > -1);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue