fix: Show item Purchase and Sold sections when date is set (#769)

Consider the case where an item has a purchase or sold date set, but no
other details, and display the sections in this case.

Fixes #759.
This commit is contained in:
Michael Manganiello
2025-06-05 18:35:53 -03:00
committed by GitHub
parent f000e14f07
commit e955183dc1

View File

@@ -325,7 +325,7 @@
if (preferences.value.showEmpty) {
return true;
}
return item.value?.purchaseFrom || item.value?.purchasePrice !== 0;
return item.value?.purchaseFrom || item.value?.purchasePrice !== 0 || validDate(item.value?.purchaseTime);
});
const purchaseDetails = computed<Details>(() => {
@@ -358,7 +358,7 @@
if (preferences.value.showEmpty) {
return true;
}
return item.value?.soldTo || item.value?.soldPrice !== 0;
return item.value?.soldTo || item.value?.soldPrice !== 0 || validDate(item.value?.soldTime);
});
const soldDetails = computed<Details>(() => {