Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/loading issue business settings #14

Merged
merged 3 commits into from
May 2, 2024

Conversation

DarinHajou
Copy link
Member

Fixed loading issue with the business registration image. The image use to load slow or stuck at infinite loading. With these changes the image loads instantaneously.

NB! Merge the changes on this branch on need by need basis.

@DarinHajou DarinHajou self-assigned this Apr 27, 2024
Copy link

changeset-bot bot commented Apr 27, 2024

⚠️ No Changeset found

Latest commit: 4c2741f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -10,9 +10,10 @@ import { NGXLogger } from 'ngx-logger';
import { SnackService } from '../../core/service/snack.service';
import { ShopService } from '../../core/service/shop.service';
import { IShopData } from '../../core/model/business';
import { ChangeDetectorRef } from '@angular/core';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can consolidate this w/ the existing @angular/core import.

reader.readAsDataURL(event.target.files[0]);
this.image = event.target.files[0];
this.isLoadingPreview = true;
onFileChange(event: Event): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you adjust the alignment in this function?


const response = await this.shopServices.registerShop(datas);
reader.onerror = () => {
console.error("Failed to read file!");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to move away from client-side console logging, especially in prod. Can you change this and other console instances to a logger instead? You can reference logger instances in the existing code.

this.registerShopForm.markAllAsTouched();
this.logger.warn('Invalid data logged');
this.logger.info(this.registerShopForm.value);
} catch (error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you align the catch and finally block?

}
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you align the else block?

Copy link
Member

@swoocn swoocn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have my approval granted you tested the new changes in the sandbox + PR comments have been addressed. Comments are mostly regarding minor adjustments with the exception of console logging. Other than that, the main mod looks good; great work, @DarinHajou!

@swoocn swoocn merged commit 82d0cee into dev May 2, 2024
1 check passed
@swoocn swoocn deleted the fix/loading-issue-business-settings branch May 2, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants