mirror of
https://github.com/everoddandeven/monerod-gui.git
synced 2024-12-22 19:49:27 +00:00
[code quality] fix async without wait, fix error typing
This commit is contained in:
parent
33edf603dc
commit
ed245953d1
1 changed files with 8 additions and 8 deletions
|
@ -229,14 +229,14 @@ export class DaemonService {
|
||||||
this.onDaemonStopEnd.emit();
|
this.onDaemonStopEnd.emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async openDatabase(): Promise<IDBPDatabase> {
|
private async openDatabase(): Promise<IDBPDatabase<any>> {
|
||||||
return openDB(this.dbName, 1, {
|
return await openDB<any>(this.dbName, 1, {
|
||||||
upgrade(db) {
|
upgrade(db) {
|
||||||
// Crea un archivio (store) per i settings se non esiste già
|
// Crea un archivio (store) per i settings se non esiste già
|
||||||
if (!db.objectStoreNames.contains('settingsStore')) {
|
if (!db.objectStoreNames.contains('settingsStore')) {
|
||||||
db.createObjectStore('settingsStore', {
|
db.createObjectStore('settingsStore', {
|
||||||
keyPath: 'id',
|
keyPath: 'id',
|
||||||
autoIncrement: true,
|
autoIncrement: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -257,7 +257,7 @@ export class DaemonService {
|
||||||
try {
|
try {
|
||||||
await this.restartDaemon();
|
await this.restartDaemon();
|
||||||
}
|
}
|
||||||
catch(error) {
|
catch(error: any) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -324,7 +324,7 @@ export class DaemonService {
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error: any) {
|
||||||
if (error instanceof HttpErrorResponse) {
|
if (error instanceof HttpErrorResponse) {
|
||||||
if (error.status == 0) {
|
if (error.status == 0) {
|
||||||
const wasRunning = this.daemonRunning;
|
const wasRunning = this.daemonRunning;
|
||||||
|
@ -405,7 +405,7 @@ export class DaemonService {
|
||||||
try {
|
try {
|
||||||
await startPromise;
|
await startPromise;
|
||||||
}
|
}
|
||||||
catch(error) {
|
catch(error: any) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -426,7 +426,7 @@ export class DaemonService {
|
||||||
await this.startDaemon();
|
await this.startDaemon();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(error) {
|
catch(error: any) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
err = error;
|
err = error;
|
||||||
}
|
}
|
||||||
|
@ -442,7 +442,7 @@ export class DaemonService {
|
||||||
try {
|
try {
|
||||||
await this.callRpc(new EmptyRpcRequest());
|
await this.callRpc(new EmptyRpcRequest());
|
||||||
}
|
}
|
||||||
catch(error) {
|
catch(error: any) {
|
||||||
if (error instanceof MethodNotFoundError) {
|
if (error instanceof MethodNotFoundError) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue