mirror of
https://github.com/everoddandeven/monerod-gui.git
synced 2024-10-29 18:37:34 +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();
|
||||
}
|
||||
|
||||
private async openDatabase(): Promise<IDBPDatabase> {
|
||||
return openDB(this.dbName, 1, {
|
||||
private async openDatabase(): Promise<IDBPDatabase<any>> {
|
||||
return await openDB<any>(this.dbName, 1, {
|
||||
upgrade(db) {
|
||||
// Crea un archivio (store) per i settings se non esiste già
|
||||
if (!db.objectStoreNames.contains('settingsStore')) {
|
||||
db.createObjectStore('settingsStore', {
|
||||
keyPath: 'id',
|
||||
autoIncrement: true,
|
||||
autoIncrement: true
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -257,7 +257,7 @@ export class DaemonService {
|
|||
try {
|
||||
await this.restartDaemon();
|
||||
}
|
||||
catch(error) {
|
||||
catch(error: any) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ export class DaemonService {
|
|||
|
||||
return response;
|
||||
}
|
||||
catch (error) {
|
||||
catch (error: any) {
|
||||
if (error instanceof HttpErrorResponse) {
|
||||
if (error.status == 0) {
|
||||
const wasRunning = this.daemonRunning;
|
||||
|
@ -405,7 +405,7 @@ export class DaemonService {
|
|||
try {
|
||||
await startPromise;
|
||||
}
|
||||
catch(error) {
|
||||
catch(error: any) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
|
@ -426,7 +426,7 @@ export class DaemonService {
|
|||
await this.startDaemon();
|
||||
}
|
||||
}
|
||||
catch(error) {
|
||||
catch(error: any) {
|
||||
console.error(error);
|
||||
err = error;
|
||||
}
|
||||
|
@ -442,7 +442,7 @@ export class DaemonService {
|
|||
try {
|
||||
await this.callRpc(new EmptyRpcRequest());
|
||||
}
|
||||
catch(error) {
|
||||
catch(error: any) {
|
||||
if (error instanceof MethodNotFoundError) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue