mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-05 17:32:09 +02:00
History: reset filter before setting new values
This ensures an empty/invalid field does not keep the old bound
This commit is contained in:
parent
24a66c184d
commit
9af3c7e03e
@ -70,6 +70,15 @@ Rectangle {
|
|||||||
return count + qsTr(" selected: ") + sign + walletManager.displayAmount(total);
|
return count + qsTr(" selected: ") + sign + walletManager.displayAmount(total);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetFilter(model) {
|
||||||
|
model.dateFromFilter = "2014-04-18" // genesis block
|
||||||
|
model.dateToFilter = "9999-09-09" // fix before september 9999
|
||||||
|
// negative values disable filters here;
|
||||||
|
model.amountFromFilter = -1;
|
||||||
|
model.amountToFilter = -1;
|
||||||
|
model.directionFilter = TransactionInfo.Direction_Both;
|
||||||
|
}
|
||||||
|
|
||||||
onModelChanged: {
|
onModelChanged: {
|
||||||
if (typeof model !== 'undefined') {
|
if (typeof model !== 'undefined') {
|
||||||
|
|
||||||
@ -285,6 +294,8 @@ Rectangle {
|
|||||||
|
|
||||||
model.paymentIdFilter = paymentIdLine.text
|
model.paymentIdFilter = paymentIdLine.text
|
||||||
|
|
||||||
|
resetFilter(model)
|
||||||
|
|
||||||
if (fromDatePicker.currentDate > toDatePicker.currentDate) {
|
if (fromDatePicker.currentDate > toDatePicker.currentDate) {
|
||||||
console.error("Invalid date filter set: ", fromDatePicker.currentDate, toDatePicker.currentDate)
|
console.error("Invalid date filter set: ", fromDatePicker.currentDate, toDatePicker.currentDate)
|
||||||
} else {
|
} else {
|
||||||
@ -295,16 +306,10 @@ Rectangle {
|
|||||||
if (advancedFilteringCheckBox.checked) {
|
if (advancedFilteringCheckBox.checked) {
|
||||||
if (amountFromLine.text.length) {
|
if (amountFromLine.text.length) {
|
||||||
model.amountFromFilter = parseFloat(amountFromLine.text)
|
model.amountFromFilter = parseFloat(amountFromLine.text)
|
||||||
} else {
|
|
||||||
// negative value disables filter here;
|
|
||||||
model.amountFromFilter = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (amountToLine.text.length) {
|
if (amountToLine.text.length) {
|
||||||
model.amountToFilter = parseFloat(amountToLine.text)
|
model.amountToFilter = parseFloat(amountToLine.text)
|
||||||
} else {
|
|
||||||
// negative value disables filter here;
|
|
||||||
model.amountToFilter = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var directionFilter = transactionsModel.get(transactionTypeDropdown.currentIndex).value
|
var directionFilter = transactionsModel.get(transactionTypeDropdown.currentIndex).value
|
||||||
|
Loading…
Reference in New Issue
Block a user