Skip to content

Commit 9d93503

Browse files
committed
feat: add a shortcut icon on the toolbar to quickly filter by favorite animes
1 parent 0e90e2e commit 9d93503

3 files changed

Lines changed: 33 additions & 3 deletions

File tree

src/app/modules/popup/layout/layout.component.html

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,36 @@
3737
<app-search-input [(value)]="searchValue" (tap)="onSearchTap()" (valueChange)="onSearchValueChange($event)"></app-search-input>
3838
</section>
3939
<section mdcTopAppBarSection alignEnd>
40-
<button mdcTopAppBarAction class="material-icons" label="Notifications" [class.red-color]="notifications.hasUnread()" (click)="toggleNotifications()">{{ notifications.hasUnread() ? 'notifications_active' : 'notifications' }}</button>
41-
<a [routerLink]="['/settings']" mdcTopAppBarAction class="material-icons" label="Settings">settings</a>
40+
<a
41+
*ngIf="settings.openInNewTab"
42+
[routerLink]="['/']"
43+
[queryParams]="{ view: view === views.Favorites ? views.Latest : views.Favorites }"
44+
[title]="view === views.Favorites ? 'Show all' : 'Show favorites'"
45+
mdcTopAppBarAction
46+
class="material-icons"
47+
label="Show favorites"
48+
>
49+
{{ view === views.Favorites ? 'favorite' : 'favorite_border' }}
50+
</a>
51+
<button
52+
mdcTopAppBarAction
53+
class="material-icons"
54+
label="Notifications"
55+
title="Notifications"
56+
[class.red-color]="notifications.hasUnread()"
57+
(click)="toggleNotifications()"
58+
>
59+
{{ notifications.hasUnread() ? 'notifications_active' : 'notifications' }}
60+
</button>
61+
<a
62+
[routerLink]="['/settings']"
63+
mdcTopAppBarAction
64+
class="material-icons"
65+
label="Settings"
66+
title="Settings"
67+
>
68+
settings
69+
</a>
4270
</section>
4371
</div>
4472
<div mdcLinearProgress [indeterminate]="true" [closed]="!isLoading"></div>

src/app/modules/popup/layout/layout.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { View } from 'src/app/models/settings';
33
import { Router } from '@angular/router';
44
import { DebugService } from 'src/app/services/debug.service';
55
import { NotificationsService } from 'src/app/services/notifications.service';
6+
import { SettingsService } from 'src/app/services/settings.service';
67

78
@Component({
89
selector: 'app-layout',
@@ -24,6 +25,7 @@ export class LayoutComponent implements OnInit {
2425
constructor(
2526
public router: Router,
2627
private debug: DebugService,
28+
public settings: SettingsService,
2729
public notifications: NotificationsService
2830
) {
2931
this.debug.log('Router url:', this.router.url);

src/app/services/settings.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class SettingsService {
7070
getDefaults() {
7171
return {
7272
proxy: this.browser.isWebExtension ? '' : CORSProxies[0].url,
73-
openInNewTab: this.browser.isFirefox ? true : false,
73+
openInNewTab: !this.browser.isWebExtension || this.browser.isFirefox ? true : false,
7474
openLinksInInactiveTabs: true,
7575
maxEpisodesToRetrieve: 50,
7676
enableDebugging: false,

0 commit comments

Comments
 (0)