mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-27 02:41:53 +00:00
* fix Tor logs actually fetching od logs * chore: update to Angular 18 * chore: update to Angular 19 * bump patchDB * chore: update Angular * chore: fix setup-wizard success page * chore: fix * chore: fix * chore: fix * chore: fix --------- Co-authored-by: Matt Hill <mattnine@protonmail.com> Co-authored-by: Aiden McClelland <me@drbonez.dev>
63 lines
1.4 KiB
TypeScript
63 lines
1.4 KiB
TypeScript
import {
|
|
ChangeDetectionStrategy,
|
|
Component,
|
|
inject,
|
|
Input,
|
|
OnDestroy,
|
|
signal,
|
|
} from '@angular/core'
|
|
import { Subject, takeUntil } from 'rxjs'
|
|
import { AbstractCategoryService } from '../../services/category.service'
|
|
import { StoreDataWithUrl } from '../../types'
|
|
|
|
@Component({
|
|
selector: 'menu',
|
|
templateUrl: './menu.component.html',
|
|
styleUrls: ['./menu.component.scss'],
|
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
standalone: false,
|
|
})
|
|
export class MenuComponent implements OnDestroy {
|
|
@Input({ required: true })
|
|
registry!: StoreDataWithUrl | null
|
|
|
|
private destroy$ = new Subject<void>()
|
|
private readonly categoryService = inject(AbstractCategoryService)
|
|
category = ''
|
|
query = ''
|
|
readonly open = signal(false)
|
|
|
|
ngOnInit() {
|
|
this.categoryService
|
|
.getQuery$()
|
|
.pipe(takeUntil(this.destroy$))
|
|
.subscribe(val => {
|
|
this.query = val
|
|
})
|
|
|
|
this.categoryService
|
|
.getCategory$()
|
|
.pipe(takeUntil(this.destroy$))
|
|
.subscribe(val => {
|
|
this.category = val
|
|
})
|
|
}
|
|
|
|
onCategoryChange(category: string): void {
|
|
this.category = category
|
|
this.query = ''
|
|
this.categoryService.resetQuery()
|
|
this.categoryService.changeCategory(category)
|
|
}
|
|
|
|
onQueryChange(query: string): void {
|
|
this.query = query
|
|
this.categoryService.setQuery(query)
|
|
}
|
|
|
|
ngOnDestroy(): void {
|
|
this.destroy$.next()
|
|
this.destroy$.complete()
|
|
}
|
|
}
|