I have two properties configured through XML, they are two currencies for currency converter app, so they cannot be the same, but I don't know how to prevent this if a user types the same value for both.
When I try to check for value in setter like this:
_quoteCurrency;
@api get quoteCurrency() {
return this._quoteCurrency;
}
set quoteCurrency(value) {
console.log(`_quoteCurrency ${this._quoteCurrency}`);
if (value === this.baseCurrency) {
return;
}
this._quoteCurrency = value;
}
_baseCurrency;
@api get baseCurrency() {
console.log(`_baseCurrency ${this._baseCurrency}`);
return this._baseCurrency;
}
set baseCurrency(value) {
console.log(`_baseCurrency ${this._baseCurrency}`);
if (value === this.quoteCurrency) {
return;
}
this._baseCurrency = value;
}
It just breaks the view (stops responding correctly) in AppBuilder when I enter something like that - that shouldn't be allowed!
What I would prefer - on entering same value as for the other property, the current property to clean its value or show some kind of error, but I don't know how to do that. Please help :)