Use switchMap param instead of re-reading this.route.snapshot.fragment

This commit is contained in:
nymkappa committed 2022-02-10 00:24:00 +09:00
1 parent c9ad316ed5
commit aa77faf314
1 file changed
+2 -2
@@ -31,8 +31,8 @@ export class TelevisionComponent implements OnInit {
this.route.fragment
.pipe(
switchMap(() => {
switch (this.route.snapshot.fragment) {
switchMap((fragment) => {
switch (fragment) {
case '2h': return this.apiService.list2HStatistics$();
case '24h': return this.apiService.list24HStatistics$();
case '1w': return this.apiService.list1WStatistics$();