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:
parent
a31af1dfe7
commit
da48f70267
1 changed files with 6 additions and 9 deletions
|
@ -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;
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue