Lint files.

This commit is contained in:
Spencer Ofwiti 2021-08-02 22:22:38 +03:00
parent 53c547e5c4
commit 45f2bc9ea8
3 changed files with 14 additions and 14 deletions

View File

@ -10,4 +10,4 @@ export * from '@app/_helpers/read-csv';
export * from '@app/_helpers/schema-validation'; export * from '@app/_helpers/schema-validation';
export * from '@app/_helpers/sync'; export * from '@app/_helpers/sync';
export * from '@app/_helpers/online-status'; export * from '@app/_helpers/online-status';
export * from './to-hex'; export * from '@app/_helpers/to-hex';

View File

@ -46,7 +46,7 @@ export class UserService {
constructor( constructor(
private httpClient: HttpClient, private httpClient: HttpClient,
private loggingService: LoggingService, private loggingService: LoggingService,
private tokenService: TokenService, private tokenService: TokenService
) {} ) {}
async init(): Promise<void> { async init(): Promise<void> {
@ -81,7 +81,7 @@ export class UserService {
userLocation: string, userLocation: string,
location: string, location: string,
locationType: string, locationType: string,
oldPhoneNumber: string, oldPhoneNumber: string
): Promise<any> { ): Promise<any> {
const accountInfo: any = { const accountInfo: any = {
vcard: { vcard: {
@ -142,11 +142,11 @@ export class UserService {
this.loggingService.sendErrorLevelMessage( this.loggingService.sendErrorLevelMessage(
'Cannot find account info in meta service', 'Cannot find account info in meta service',
this, this,
{ error }, { error }
); );
const syncableAccount: Syncable = new Syncable(accountKey, accountInfo); const syncableAccount: Syncable = new Syncable(accountKey, accountInfo);
await this.updateMeta(syncableAccount, accountKey, this.headers); await this.updateMeta(syncableAccount, accountKey, this.headers);
}, }
); );
if (phoneNumber !== oldPhoneNumber) { if (phoneNumber !== oldPhoneNumber) {
const oldPhoneKey: string = await Phone.toKey(oldPhoneNumber); const oldPhoneKey: string = await Phone.toKey(oldPhoneNumber);
@ -162,7 +162,7 @@ export class UserService {
async updateMeta( async updateMeta(
syncableAccount: Syncable, syncableAccount: Syncable,
accountKey: string, accountKey: string,
headers: HttpHeaders, headers: HttpHeaders
): Promise<any> { ): Promise<any> {
const envelope: Envelope = await this.wrap(syncableAccount, this.signer); const envelope: Envelope = await this.wrap(syncableAccount, this.signer);
const reqBody: string = envelope.toJSON(); const reqBody: string = envelope.toJSON();
@ -223,7 +223,7 @@ export class UserService {
this.tokenService.load.subscribe(async (status: boolean) => { this.tokenService.load.subscribe(async (status: boolean) => {
if (status) { if (status) {
data.balance = await this.tokenService.getTokenBalance( data.balance = await this.tokenService.getTokenBalance(
data.identities.evm[`bloxberg:${environment.bloxbergChainId}`][0], data.identities.evm[`bloxberg:${environment.bloxbergChainId}`][0]
); );
} }
}); });
@ -237,7 +237,7 @@ export class UserService {
}); });
} else { } else {
this.loggingService.sendInfoLevelMessage( this.loggingService.sendInfoLevelMessage(
'Web workers are not supported in this environment', 'Web workers are not supported in this environment'
); );
for (const accountAddress of accountAddresses.slice(offset, offset + limit)) { for (const accountAddress of accountAddresses.slice(offset, offset + limit)) {
await this.getAccountByAddress(accountAddress, limit); await this.getAccountByAddress(accountAddress, limit);
@ -252,7 +252,7 @@ export class UserService {
async getAccountByAddress( async getAccountByAddress(
accountAddress: string, accountAddress: string,
limit: number = 100, limit: number = 100,
history: boolean = false, history: boolean = false
): Promise<Observable<AccountDetails>> { ): Promise<Observable<AccountDetails>> {
const accountSubject: Subject<any> = new Subject<any>(); const accountSubject: Subject<any> = new Subject<any>();
this.getAccountDetailsFromMeta(await User.toKey(add0x(accountAddress))) this.getAccountDetailsFromMeta(await User.toKey(add0x(accountAddress)))
@ -272,7 +272,7 @@ export class UserService {
this.tokenService.load.subscribe(async (status: boolean) => { this.tokenService.load.subscribe(async (status: boolean) => {
if (status) { if (status) {
accountInfo.balance = await this.tokenService.getTokenBalance( accountInfo.balance = await this.tokenService.getTokenBalance(
accountInfo.identities.evm[`bloxberg:${environment.bloxbergChainId}`][0], accountInfo.identities.evm[`bloxberg:${environment.bloxbergChainId}`][0]
); );
} }
}); });
@ -286,7 +286,7 @@ export class UserService {
async getAccountByPhone( async getAccountByPhone(
phoneNumber: string, phoneNumber: string,
limit: number = 100, limit: number = 100
): Promise<Observable<AccountDetails>> { ): Promise<Observable<AccountDetails>> {
const accountSubject: Subject<any> = new Subject<any>(); const accountSubject: Subject<any> = new Subject<any>();
this.getAccountDetailsFromMeta(await Phone.toKey(phoneNumber)) this.getAccountDetailsFromMeta(await Phone.toKey(phoneNumber))
@ -318,7 +318,7 @@ export class UserService {
const keywords = product.toLowerCase().split(' '); const keywords = product.toLowerCase().split(' ');
for (const keyword of keywords) { for (const keyword of keywords) {
const queriedCategory: string = Object.keys(categories).find((key) => const queriedCategory: string = Object.keys(categories).find((key) =>
categories[key].includes(keyword), categories[key].includes(keyword)
); );
if (queriedCategory) { if (queriedCategory) {
return queriedCategory; return queriedCategory;
@ -343,7 +343,7 @@ export class UserService {
const savedIndex = this.accounts.findIndex( const savedIndex = this.accounts.findIndex(
(acc) => (acc) =>
acc.identities.evm[`bloxberg:${environment.bloxbergChainId}`][0] === acc.identities.evm[`bloxberg:${environment.bloxbergChainId}`][0] ===
account.identities.evm[`bloxberg:${environment.bloxbergChainId}`][0], account.identities.evm[`bloxberg:${environment.bloxbergChainId}`][0]
); );
if (savedIndex === 0) { if (savedIndex === 0) {
return; return;

View File

@ -29,7 +29,7 @@ addEventListener('message', async ({ data }) => {
async function getAccountByAddress( async function getAccountByAddress(
accountAddress: string, accountAddress: string,
metaUrl: string, metaUrl: string,
token: string, token: string
): Promise<any> { ): Promise<any> {
const userKey = await User.toKey(add0x(accountAddress)); const userKey = await User.toKey(add0x(accountAddress));