Fix some typescript linter errors

This commit is contained in:
Daniel 2024-04-18 14:24:43 +02:00
parent 21c4fa456b
commit 0c61f2c35e

View file

@ -1,4 +1,3 @@
import { Min } from './../../../../dist-lib/safing/portmaster-api/lib/netquery.service.d';
import { import {
ChangeDetectionStrategy, ChangeDetectionStrategy,
ChangeDetectorRef, ChangeDetectorRef,
@ -19,10 +18,10 @@ import {
Record, Record,
deepClone, deepClone,
} from '@safing/portmaster-api'; } from '@safing/portmaster-api';
import { Subscription, map, of, throwError } from 'rxjs'; import { Subscription, map, of } from 'rxjs';
import { catchError, switchMap } from 'rxjs/operators'; import { switchMap } from 'rxjs/operators';
import { INTEGRATION_SERVICE, ProcessInfo } from 'src/app/integration';
import { AppIconResolver } from './app-icon-resolver'; import { AppIconResolver } from './app-icon-resolver';
import { AppProfile } from 'projects/safing/portmaster-api/src/public-api';
// Interface that must be satisfied for the profile-input // Interface that must be satisfied for the profile-input
// of app-icon. // of app-icon.
@ -107,11 +106,11 @@ export class AppIconComponent implements OnInit, OnDestroy {
isIgnoredProfile = false; isIgnoredProfile = false;
/** If not icon is available, this holds the first - uppercased - letter of the app - name */ /** If not icon is available, this holds the first - uppercased - letter of the app - name */
letter: string = ''; letter = '';
/** @private The background color of the component, based on icon availability and generated by ID */ /** @private The background color of the component, based on icon availability and generated by ID */
@HostBinding('style.background-color') @HostBinding('style.background-color')
color: string = 'var(--text-tertiary)'; color = 'var(--text-tertiary)';
constructor( constructor(
private profileService: AppProfileService, private profileService: AppProfileService,
@ -167,7 +166,7 @@ export class AppIconComponent implements OnInit, OnDestroy {
} }
if (!skipIcon) { if (!skipIcon) {
this.tryGetSystemIcon(p); this.tryGetSystemIcon();
} }
} else { } else {
@ -204,7 +203,7 @@ export class AppIconComponent implements OnInit, OnDestroy {
return null; return null;
} }
let id = this.profile.ID; const id = this.profile.ID;
if (!id) { if (!id) {
return null; return null;
} }
@ -215,7 +214,7 @@ export class AppIconComponent implements OnInit, OnDestroy {
} }
// otherwise, ID likely contains the source // otherwise, ID likely contains the source
let [source, ...rest] = id.split('/'); const [source, ...rest] = id.split('/');
if (rest.length > 0) { if (rest.length > 0) {
return [source, rest.join('/')]; return [source, rest.join('/')];
} }
@ -229,7 +228,7 @@ export class AppIconComponent implements OnInit, OnDestroy {
* Tries to get the application icon form the system. * Tries to get the application icon form the system.
* Requires the app to be running in the electron wrapper. * Requires the app to be running in the electron wrapper.
*/ */
private tryGetSystemIcon(p: IDandName) { private tryGetSystemIcon() {
const sourceAndId = this.getIDAndSource(); const sourceAndId = this.getIDAndSource();
if (sourceAndId === null) { if (sourceAndId === null) {
return; return;
@ -240,7 +239,7 @@ export class AppIconComponent implements OnInit, OnDestroy {
this.sub = this.profileService this.sub = this.profileService
.watchAppProfile(sourceAndId[0], sourceAndId[1]) .watchAppProfile(sourceAndId[0], sourceAndId[1])
.pipe( .pipe(
switchMap((profile) => { switchMap((profile: AppProfile) => {
this.updateLetter(profile); this.updateLetter(profile);
if (!!profile.Icons?.length) { if (!!profile.Icons?.length) {