copay-crown
Version:
A Secure Crown Wallet
62 lines (51 loc) • 1.4 kB
text/typescript
import { Component } from '@angular/core';
import { Logger } from '../../../providers/logger/logger';
// providers
import { ConfigProvider } from '../../../providers/config/config';
export class AdvancedPage {
public spendUnconfirmed: boolean;
public recentTransactionsEnabled: boolean;
public useLegacyAddress: boolean;
constructor(
private configProvider: ConfigProvider,
private logger: Logger
) {
}
ionViewDidLoad() {
this.logger.info('ionViewDidLoad AdvancedPage');
}
ionViewWillEnter() {
let config: any = this.configProvider.get();
this.spendUnconfirmed = config.wallet.spendUnconfirmed;
this.recentTransactionsEnabled = config.recentTransactions.enabled;
this.useLegacyAddress = config.wallet.useLegacyAddress;
}
public spendUnconfirmedChange(): void {
let opts = {
wallet: {
spendUnconfirmed: this.spendUnconfirmed
}
};
this.configProvider.set(opts);
}
public recentTransactionsChange(): void {
let opts = {
recentTransactions: {
enabled: this.recentTransactionsEnabled
}
};
this.configProvider.set(opts);
}
public useLegacyAddressChange(): void {
let opts = {
wallet: {
useLegacyAddress: this.useLegacyAddress
}
};
this.configProvider.set(opts);
}
}