Filter text in archive viewer now resets when changing other filters

This commit is contained in:
Isaac Abadi
2023-03-27 18:32:05 -04:00
parent c1fd8047ea
commit 9c4f903811
2 changed files with 6 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
<mat-form-field class="filter">
<mat-icon matPrefix>search</mat-icon>
<mat-label i18n="Filter">Filter</mat-label>
<input matInput (keyup)="applyFilter($event)" #input>
<input matInput [(ngModel)]="text_filter" (keyup)="applyFilter($event)" #input>
</mat-form-field>
<div [hidden]="!(archives && archives.length > 0)">

View File

@@ -23,6 +23,7 @@ export class ArchiveViewerComponent {
// general
archives = null;
archives_retrieved = false;
text_filter = '';
sub_id = 'none';
upload_sub_id = 'none';
type: FileType | 'both' = 'both';
@@ -78,11 +79,15 @@ export class ArchiveViewerComponent {
typeFilterSelectionChanged(value): void {
this.type = value;
this.dataSource.filter = '';
this.text_filter = '';
this.getArchives();
}
subFilterSelectionChanged(value): void {
this.sub_id = value;
this.dataSource.filter = '';
this.text_filter = '';
if (this.sub_id !== 'none') {
this.type = this.postsService.getSubscriptionByID(this.sub_id)['type'];
}