Skip to content

Commit

Permalink
Rename register to create
Browse files Browse the repository at this point in the history
  • Loading branch information
miladsoft committed Oct 31, 2024
1 parent 6aed68e commit 576b0fa
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 16 deletions.
5 changes: 2 additions & 3 deletions src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import { LuxonDateAdapter } from '@angular/material-luxon-adapter';
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
import { provideAnimations } from '@angular/platform-browser/animations';
import {
PreloadAllModules,
provideRouter,
provideRouter,
withInMemoryScrolling,

} from '@angular/router';
import { provideServiceWorker } from '@angular/service-worker';
import { TranslocoService, provideTransloco } from '@ngneat/transloco';
Expand Down
4 changes: 2 additions & 2 deletions src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export const appRoutes: Route[] = [
import('app/components/auth/login/login.routes'),
},
{
path: 'register',
path: 'create',
loadChildren: () =>
import('app/components/auth/register/register.routes'),
import('app/components/auth/create/create.routes'),
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div
class="mt-8 text-4xl font-extrabold leading-tight tracking-tight"
>
Register
Create account
</div>
<div class="mt-0.5 flex items-baseline font-medium">
<div>Already have an account?</div>
Expand Down Expand Up @@ -97,7 +97,7 @@
[disabled]="!registerForm.valid || !generatedKeys"
(click)="register()"
>
<span>Create your account</span>
<span>Create account</span>
<mat-progress-spinner
*ngIf="registerForm.disabled"
[diameter]="24"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import { Router, RouterLink } from '@angular/router';
import { SignerService } from 'app/services/signer.service';

@Component({
selector: 'auth-register',
templateUrl: './register.component.html',
selector: 'auth-create',
templateUrl: './create.component.html',
encapsulation: ViewEncapsulation.None,
animations: angorAnimations,
standalone: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Routes } from '@angular/router';
import { RegisterComponent } from 'app/components/auth/register/register.component';
import { RegisterComponent } from 'app/components/auth/create/create.component';

export default [
{
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/auth/login/login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<div>Don't have an account?</div>
<a
class="ml-1 text-primary-500 hover:underline"
[routerLink]="['/register']"
>Register</a
[routerLink]="['/create']"
>Create account</a
>
</div>

Expand Down
12 changes: 8 additions & 4 deletions src/app/components/profile/profile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,24 +250,28 @@ export class ProfileComponent implements OnInit, OnDestroy {
{ authors: [pubKey], kinds: [0], limit: 1 }
];


this.subscriptionId = this._subscriptionService.addSubscriptions(filters, async (event: NostrEvent) => {
try {

const newMetadata = JSON.parse(event.content);
this.profileUser = newMetadata;

// Set followers and following counts, ensure they're integers and not null or undefined
this.followersCount = newMetadata.followersCount ?? 0;
this.followingCount = newMetadata.followingCount ?? 0;

// Save profile data
await this._storageService.saveProfile(pubKey, newMetadata);


this._changeDetectorRef.detectChanges();
// Mark for check to force UI update
this._changeDetectorRef.markForCheck();
} catch (error) {
console.error('Error processing metadata event:', error);
}
});
}



getSafeUrl(url: string): SafeUrl {
return this._sanitizer.bypassSecurityTrustUrl(url);
}
Expand Down

0 comments on commit 576b0fa

Please sign in to comment.