import { Component } from "@angular/core" ; import { Router } from "@angular/router" ; import { ElectronService , ContextMenuService , SetService , } from "../../../core/services" ; import { Sets , FilesSet , Import } from "../../../data" ; import { navigationNewItem } from "../../animations" ; @ Component ( { selector : "app-navigation" , templateUrl : "./navigation.component.html" , styleUrls : [ "./navigation.component.scss" ] , animations : [ navigationNewItem ] , } ) export class NavigationComponent { public sets = Sets ; public import = Import ; constructor ( public router , public electronService , private contextMenuService , private setService ) { } public getNotOptimizied ( set ) { return set . statistics . notOptimized ; } public setClipboardLink ( ) { return Boolean ( this . electronService . settings . getSync ( "app.clipboardWatcher" ) ) ; } public isThereNotOptimizedFiles ( ) { return ! ! Sets . find ( ( set ) => set . statistics . notOptimized > 0 ) ; } public addSet ( ) { const set = new FilesSet ( { name : `New files set` } ) ; Sets . push ( set ) ; setTimeout ( ( ) => { this . router . navigate ( [ "/sets/" + set . id ] ) ; } ) ; this . setService . saveSets ( ) ; } public openFeedbackPage ( ) { this . electronService . shell . openExternal ( `mailto:a.katrukhin@gmail.com` ) ; } public navigationStatus ( ) { return Boolean ( this . electronService . settings . getSync ( "appearance.smallNav" ) ) ; } public onRightClick ( set ) { this . contextMenuService . showOnNavigationItem ( set ) ; } }