0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Fixed empty member attribution filter loading state

refs https://ghost.slack.com/archives/C02G9E68C/p1661442387532489?thread_ts=1661419289.348579&cid=C02G9E68C

When filtering on attribution, the filter was already applied when the array was empty, causing an invalid NQL filter.
This commit is contained in:
Simon Backx 2022-08-25 18:03:32 +02:00
parent a31af1dfe7
commit da48f70267

View file

@ -493,11 +493,8 @@ export default class MembersFilter extends Component {
@action
applySoftFilter() {
const validFilters = this.filters.filter((filter) => {
if (filter.type === 'label') {
return filter.value?.length;
}
if (filter.type === 'tier') {
return filter.value?.length;
if (Array.isArray(filter.value)) {
return filter.value.length;
}
return filter.value;
});
@ -508,8 +505,8 @@ export default class MembersFilter extends Component {
@action
applyFilter() {
const validFilters = this.filters.filter((filter) => {
if (['label', 'tier'].includes(filter.type)) {
return filter.value?.length;
if (Array.isArray(filter.value)) {
return filter.value.length;
}
return filter.value;
});
@ -521,8 +518,8 @@ export default class MembersFilter extends Component {
@action
applyParsedFilter() {
const validFilters = this.filters.filter((filter) => {
if (['label', 'tier'].includes(filter.type)) {
return filter.value?.length;
if (Array.isArray(filter.value)) {
return filter.value.length;
}
return filter.value;
});