Skip to content

Commit

Permalink
Merge pull request #131 from NazarUsov/2.1.0
Browse files Browse the repository at this point in the history
Fixes for release 2.1.0
  • Loading branch information
sowle authored Nov 6, 2024
2 parents ad7cc4a + 341a3af commit 4bb0de1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import { BehaviorSubject } from 'rxjs';
placeholder="{{ 'PLACEHOLDERS.PLACEHOLDER_NEW' | translate }}"
type="password"
/>
<div *ngIf="createForm.controls.path.dirty && createForm.controls.password.invalid" class="error">
<div *ngIf="createForm.controls.password.dirty && createForm.controls.password.invalid" class="error">
<div *ngIf="createForm.controls.password.hasError('pattern')">
{{ 'ERRORS.REGEXP_INVALID_PASSWORD' | translate }}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h1 class="ml-2">{{ 'BREADCRUMBS.ADD_WALLET' | translate }}</h1>
</div>

<!-- Password -->
<div class="form__field fixed">
<div class="form__field">
<label for="password">{{ 'RESTORE_WALLET.PASS' | translate }}</label>
<input
(contextmenu)="variablesService.onContextMenuPasteSelect($event)"
Expand All @@ -49,10 +49,10 @@ <h1 class="ml-2">{{ 'BREADCRUMBS.ADD_WALLET' | translate }}</h1>
[placeholder]="'PLACEHOLDERS.WALET_PASSWORD_PLACEHOLDER' | translate"
type="password"
/>
<ng-container *ngIf="form.get('password') as control">
<ng-container *ngIf="form.controls.password as control">
<div *ngIf="control | isVisibleControlError" class="error">
<div *ngIf="control.hasError('pattern')">
{{ 'ERRORS.WRONG_PASSWORD' | translate }}
{{ 'ERRORS.REGEXP_INVALID_PASSWORD' | translate }}
</div>
</div>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Wallet } from '@api/models/wallet.model';
import { TranslateService } from '@ngx-translate/core';
import { debounceTime, startWith, takeUntil } from 'rxjs/operators';
import { combineLatest, Subject } from 'rxjs';
import { ZanoValidators } from '@parts/utils/zano-validators';
import { regExpPassword, ZanoValidators } from '@parts/utils/zano-validators';
import { WalletsService } from '@parts/services/wallets.service';
import { BreadcrumbItems } from '@parts/components/breadcrumbs/breadcrumbs.models';

Expand Down Expand Up @@ -64,7 +64,7 @@ export class RestoreWalletComponent implements OnInit, OnDestroy {
ZanoValidators.duplicate(this.variablesService.walletNamesForComparisons),
]),
seedPhrase: this._fb.control('', Validators.required),
password: this._fb.control(''),
password: this._fb.control('', Validators.pattern(regExpPassword)),
confirm: this._fb.control(''),
seedPassword: this._fb.control(''),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class HistoryComponent implements OnInit, OnDestroy {

this.variablesService.currentWalletChangedEvent.pipe(filter(Boolean), takeUntil(this._destroy$)).subscribe({
next: (wallet: Wallet) => {
this.getRecentTransfers();
// this.getRecentTransfers();
this.mining = wallet.exclude_mining_txs;
},
});
Expand Down
18 changes: 9 additions & 9 deletions html_source/src/app/parts/pipes/is-visible-control-error.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { Pipe, PipeTransform } from '@angular/core';
import { AbstractControl } from '@angular/forms';

@Pipe({
name: 'isVisibleControlError',
standalone: true
name: 'isVisibleControlError',
standalone: true,
pure: false,
})
export class IsVisibleControlErrorPipe implements PipeTransform {

transform(control: AbstractControl | null): boolean {
if (!control) {
return false;
}
return control.invalid && (control.dirty || control.touched);
}
transform(control: AbstractControl | null): boolean {
if (!control) {
return false;
}
return control.invalid && (control.dirty || control.touched);
}
}
1 change: 1 addition & 0 deletions html_source/src/assets/scss/components/_wallet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
font-size: 0.8rem;
padding: 0.2rem 0.5rem;
border-radius: 999px;
z-index: 10;

position: absolute;
right: -0.5rem;
Expand Down

0 comments on commit 4bb0de1

Please sign in to comment.