Skip to content

Commit

Permalink
Merge pull request #1008 from adshares/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
m-pilarczyk authored Feb 28, 2023
2 parents bb237d2 + 83399ca commit 65a4590
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.4.4] - 2023-02-28
### Added
- Warning before deposit if automatic withdrawal is active

## [2.4.3] - 2023-02-21
### Fixed
Display admin role on screen smaller than 1800px
Expand Down Expand Up @@ -557,7 +561,8 @@ Display admin role on screen smaller than 1800px
- Publisher features (Sites & AdUnits)


[Unreleased]: https://github.com/adshares/adpanel/compare/v2.4.3...develop
[Unreleased]: https://github.com/adshares/adpanel/compare/v2.4.4...develop
[2.4.4]: https://github.com/adshares/adpanel/compare/v2.4.3...v2.4.4
[2.4.3]: https://github.com/adshares/adpanel/compare/v2.4.2...v2.4.3
[2.4.2]: https://github.com/adshares/adpanel/compare/v2.4.1...v2.4.2
[2.4.1]: https://github.com/adshares/adpanel/compare/v2.4.0...v2.4.1
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adpanel",
"version": "2.4.3",
"version": "2.4.4",
"scripts": {
"ng": "ng",
"start": "ng serve adshares",
Expand Down
2 changes: 1 addition & 1 deletion src/app/auth/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class LoginComponent extends HandleSubscriptionComponent implements OnIni
if (HTTP_FORBIDDEN === res.status) {
this.dialog.open(ErrorResponseDialogComponent, {
data: {
title: 'Your account is banned',
title: 'Your account is locked',
message: `Info: ${res.error.reason} \n\n In case of doubts, please contact support ${this.supportEmail}`,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ <h2 class="ap-heading ap-heading--h3">
<span *ngIf="useNowPaymentsDeposit" class="now_payments_logo"><span>NOW</span>Payments</span>
<span *ngIf="!useNativeDeposit && !useNowPaymentsDeposit && !useWrappedDeposit">Deposit funds</span>
</h2>
<div *ngIf="isAutoWithdrawal" class="ap-alert ap-alert--warning">
You have automatic withdrawal turned on. Depending on your settings, deposited funds may be returned to the sender
immediately. Go to the <a (mousedown)="navigateToSettings($event)">settings</a>.
</div>
<div
*ngIf="
!useNativeDeposit && !useWrappedDeposit && !useNowPaymentsDeposit && !useFiatDeposit;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
import { Router } from '@angular/router';
import { Store } from '@ngrx/store';
import { HandleSubscriptionComponent } from 'common/handle-subscription.component';
import {
Country,
Expand All @@ -14,14 +16,17 @@ import { ApiService } from 'app/api/api.service';
import { SessionService } from 'app/session.service';
import { forkJoin as observableForkJoin } from 'rxjs';
import { isNumeric } from 'rxjs/internal-compatibility';
import { take } from 'rxjs/operators';
import { CODE, CRYPTO } from 'common/utilities/consts';
import { Contract } from 'web3-eth-contract';
import { hexToNumber } from 'web3-utils';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { SettingsService } from 'settings/settings.service';
import Web3 from 'web3';
import { ServerOptionsService } from 'common/server-options.service';
import { AppState } from 'models/app-state.model';
import { GET_ADS_FAQ } from 'models/enum/link.enum';
import { UserAdserverWallet } from 'models/user.model';
import { faCopy } from '@fortawesome/free-regular-svg-icons';
import { HelperService } from 'common/helper.service';

Expand Down Expand Up @@ -85,6 +90,7 @@ export class AddFundsDialogComponent extends HandleSubscriptionComponent impleme
appCurrency: string;
crypto: string = CRYPTO;
code: string = CODE;
isAutoWithdrawal: boolean = false;
isConfirmed = false;

loadingInfo: boolean = true;
Expand Down Expand Up @@ -133,9 +139,11 @@ export class AddFundsDialogComponent extends HandleSubscriptionComponent impleme
constructor(
public dialogRef: MatDialogRef<AddFundsDialogComponent>,
private api: ApiService,
private router: Router,
private serverOptionsService: ServerOptionsService,
private session: SessionService,
private settings: SettingsService,
private store: Store<AppState>,
private helperService: HelperService
) {
super();
Expand All @@ -146,6 +154,14 @@ export class AddFundsDialogComponent extends HandleSubscriptionComponent impleme
const user = this.session.getUser();
this.isConfirmed = user.isConfirmed;

const walletSubscription = this.store
.select('state', 'user', 'data', 'adserverWallet')
.pipe(take(2))
.subscribe((wallet: UserAdserverWallet) => {
this.isAutoWithdrawal = wallet.isAutoWithdrawal;
});
this.subscriptions.push(walletSubscription);

const infoSubscription = observableForkJoin([this.api.config.depositInfo(), this.api.config.countries()]).subscribe(
(responses: [DepositInfo, Country[]]) => {
const info = responses[0];
Expand Down Expand Up @@ -410,4 +426,8 @@ export class AddFundsDialogComponent extends HandleSubscriptionComponent impleme
}
});
}

navigateToSettings(_$event: MouseEvent): void {
this.router.navigate(['/settings', 'general', 'wallet']).then(() => this.dialogRef.close());
}
}

0 comments on commit 65a4590

Please sign in to comment.