Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
everoddandeven committed Feb 13, 2025
1 parent 6a92117 commit e0ad9f3
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/app/core/services/daemon/daemon.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,13 @@ export class DaemonService {

private async post(uri: string, params: {[key: string]: any} = {}): Promise<{[key: string]: any}> {
let headers: AxiosHeaders;
let withCredentials: boolean = false;

const login = this.getLogin();

if (login) {
const _headers = { ...this.headers };
_headers['Authorization'] = "Basic " + btoa(unescape(encodeURIComponent(`${login.username}:${login.password}`)));
headers = new AxiosHeaders(_headers);
withCredentials = true;
}
else {
headers = new AxiosHeaders(this.headers);
Expand Down
3 changes: 2 additions & 1 deletion src/app/core/services/i2p/i2p-daemon.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ export class I2pDaemonService {
private detectedInstallation?: { path: string; configFile?: string; tunnelConfig?: string; tunnelsConfigDir?: string; pidFile?: string; isRunning?: boolean; };

constructor()
{
{
this.openDbPromise = this.openDatabase();
this.openDbPromise.then(() => console.log('Loaded i2p settings database')).catch((error: any) => console.error(error));
this.loadSettings();

Check failure on line 60 in src/app/core/services/i2p/i2p-daemon.service.ts

View workflow job for this annotation

GitHub Actions / build (20)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/base-page/base-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export abstract class BasePageComponent implements AfterContentInit, OnDestroy {

protected subscriptions: Subscription[] = [];

private readonly mResizeHandler: (event: Event) => void = (event: Event) => setTimeout(() => {
private readonly mResizeHandler: () => void = () => setTimeout(() => {
this.updateTablesContentHeight();
}, 100);

Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/i2p-webconsole/i2p-webconsole.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class I2pWebconsoleComponent extends BasePageComponent implements OnDestr

reject(new Error('Wrapper not found'));
})
.catch(error => reject(error));
.catch(error => reject(error instanceof Error ? error : new Error(`${error}`)));
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/logs/logs.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AfterViewInit, Component, NgZone, OnDestroy } from '@angular/core';
import { AfterContentInit, AfterViewInit, Component, NgZone, OnDestroy } from '@angular/core';
import { LogsService } from './logs.service';
import { NavbarService } from '../../shared/components/navbar/navbar.service';
import { NavbarLink } from '../../shared/components/navbar/navbar.model';
Expand All @@ -13,7 +13,7 @@ import { Subscription } from 'rxjs';
styleUrl: './logs.component.scss',
standalone: false
})
export class LogsComponent extends BasePageComponent implements AfterViewInit, OnDestroy {
export class LogsComponent extends BasePageComponent implements AfterViewInit, AfterContentInit, OnDestroy {
private initing: boolean = false;
private scrollEventsRegistered: boolean = false;

Expand Down
1 change: 0 additions & 1 deletion src/app/shared/components/sidebar/sidebar.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Component, Input } from '@angular/core';
import { Router } from '@angular/router';
import { DaemonService } from '../../../core/services/daemon/daemon.service';
import { I2pDaemonService } from '../../../core/services';

@Component({
Expand Down
2 changes: 1 addition & 1 deletion src/common/DaemonSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export class DaemonSettings extends Comparable<DaemonSettings> {
}
}
else {
throw new Error("Invalid type provided: " + type);
throw new Error("Invalid type provided");
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ declare global {
interface Window {
electronAPI: {
detectInstallation: (program: 'monerod' | 'i2pd' | 'tor' | 'monerod-gui', callback: (info?: any) => void) => void;
httpPost: <TConfig extends {} = {}>(params: { id: string; url: string; data?: any; config?: AxiosRequestConfig<TConfig>}, callback: (result: { data?: AxiosResponse<any, any>, code: number; status: string; error?: string; }) => void) => void;
httpGet: <TConfig extends {} = {}>(params: { id: string; url: string; config?: AxiosRequestConfig<TConfig> }, callback: (result: { data?: AxiosResponse<any, any>, code: number; status: string; error?: string; }) => void) => void;
httpPost: <TConfig extends { [key: string]: any } = object>(params: { id: string; url: string; data?: any; config?: AxiosRequestConfig<TConfig>}, callback: (result: { data?: AxiosResponse<any, any>, code: number; status: string; error?: string; }) => void) => void;
httpGet: <TConfig extends { [key: string]: any } = object>(params: { id: string; url: string; config?: AxiosRequestConfig<TConfig> }, callback: (result: { data?: AxiosResponse<any, any>, code: number; status: string; error?: string; }) => void) => void;
startI2pd: (path: string, callback: (error?: any) => void) => void;
stopI2pd: (callback: (error?: any) => void) => void;
onI2pdOutput: (callback: (output: {stdout?: string, stderr?: string}) => void) => void;
Expand Down

0 comments on commit e0ad9f3

Please sign in to comment.