Code cleaned up

This commit is contained in:
piotrpekala7 2020-06-12 16:08:12 +02:00
parent 53b4e064ee
commit 7248a0f183
2 changed files with 0 additions and 16 deletions

View File

@ -48,8 +48,6 @@ export class AddServerDialogComponent implements OnInit {
async getDefaultLocation() {
console.log('get default location');
const localServers = await this.numberOfLocalServers();
if(this.electronService.isElectronApp && localServers === 0) {
return 'local';
@ -58,9 +56,7 @@ export class AddServerDialogComponent implements OnInit {
}
async numberOfLocalServers() {
console.log('calling find all');
const servers = await this.serverService.findAll();
console.log('servers from add server dialog....');
return servers.filter((server) => server.location === 'local').length;
}
@ -88,9 +84,7 @@ export class AddServerDialogComponent implements OnInit {
}
async ngOnInit() {
console.log('Start.... ');
this.locations = await this.getLocations();
console.log('Locations: ', this.locations);
const defaultLocalServerPath = await this.getDefaultLocalServerPath();
const defaultUbridgePath = await this.getDefaultUbridgePath();
@ -141,7 +135,6 @@ export class AddServerDialogComponent implements OnInit {
})
});
console.log('????');
const defaultLocation = await this.getDefaultLocation();
this.serverForm.get('location').setValue(defaultLocation);
this.serverForm.get('host').setValue(this.getDefaultHost());

View File

@ -23,7 +23,6 @@ export class ServerService {
evt.currentTarget.result.createObjectStore(this.tablename, { keyPath: 'id', autoIncrement: true });
});
}).catch(() => {
console.log('in incognito mode');
this.isIncognitoMode = true;
}).finally(() => {
this.serviceInitialized.emit(true);
@ -39,7 +38,6 @@ export class ServerService {
return promise;
}
console.log('pfffff get');
return this.onReady(() => this.indexedDbService.get().getByKey(this.tablename, id)) as Promise<Server>;
}
@ -55,7 +53,6 @@ export class ServerService {
return promise;
}
console.log('pfffff create');
return this.onReady(() => {
const promise = new Promise((resolve, reject) => {
this.indexedDbService
@ -81,7 +78,6 @@ export class ServerService {
return promise;
}
console.log('pfffff update');
return this.onReady(() => {
const promise = new Promise((resolve, reject) => {
this.indexedDbService
@ -103,13 +99,11 @@ export class ServerService {
let server: Server = JSON.parse(localStorage.getItem(n));
servers.push(server);
});
console.log('pfffff find all iin');
resolve(servers);
});
return promise;
}
console.log('pfffff find all');
return this.onReady(() => this.indexedDbService.get().getAll(this.tablename)) as Promise<Server[]>;
}
@ -124,7 +118,6 @@ export class ServerService {
return promise;
}
console.log('pfffff delete');
return this.onReady(() => this.indexedDbService.get().delete(this.tablename, server.id));
}
@ -163,8 +156,6 @@ export class ServerService {
}
protected onReady(query) {
console.log('pfffff');
const promise = new Promise((resolve, reject) => {
this.ready.then(
() => {