fix: console errors, notif error
This commit is contained in:
@@ -124,11 +124,11 @@ export class ChallengeCreateDialogComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.errorMessage = '';
|
||||
this.loading = true;
|
||||
this.form.disable();
|
||||
|
||||
const limitSeconds = Math.round((this.form.get('limitMinutes')?.value || 0) * 60);
|
||||
const incrementSeconds = this.form.get('incrementSeconds')?.value || 0;
|
||||
const ttlSeconds = this.form.get('ttlSeconds')?.value;
|
||||
const color = (this.form.get('color')?.value || 'random') as PlayerColor;
|
||||
const limitSeconds = Math.round((this.form.getRawValue().limitMinutes || 0) * 60);
|
||||
const { incrementSeconds, ttlSeconds, color: rawColor } = this.form.getRawValue();
|
||||
const color = (rawColor || 'random') as PlayerColor;
|
||||
|
||||
this.challengeService.sendChallenge(targetUsername, {
|
||||
timeControl: {
|
||||
@@ -138,7 +138,7 @@ export class ChallengeCreateDialogComponent implements OnInit, OnDestroy {
|
||||
color,
|
||||
ttlSeconds: ttlSeconds > 0 ? ttlSeconds : undefined
|
||||
})
|
||||
.pipe(finalize(() => (this.loading = false)))
|
||||
.pipe(finalize(() => { this.loading = false; this.form.enable(); }))
|
||||
.subscribe({
|
||||
next: (challenge) => {
|
||||
// Challenge sent successfully - navigate to challenges page to view status
|
||||
|
||||
Reference in New Issue
Block a user