Skip to content

Commit

Permalink
Increase readability
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Feb 12, 2024
1 parent 811f8cf commit b7b5c05
Showing 1 changed file with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,28 +199,19 @@ export default {
computed: {
/** @returns {Boolean} */
canUnhideSelection() {
return (
this.areAllSelectedHidden ||
(HistoryFilters.checkFilter(this.filterText, "visible", "any") && !this.areAllSelectedVisible)
);
return this.areAllSelectedHidden || (this.isAnyVisibilityAllowed && !this.areAllSelectedVisible);
},
/** @returns {Boolean} */
canHideSelection() {
return (
this.areAllSelectedVisible ||
(HistoryFilters.checkFilter(this.filterText, "visible", "any") && !this.areAllSelectedHidden)
);
return this.areAllSelectedVisible || (this.isAnyVisibilityAllowed && !this.areAllSelectedHidden);
},
/** @returns {Boolean} */
showDeleted() {
return !HistoryFilters.checkFilter(this.filterText, "deleted", false);
},
/** @returns {Boolean} */
canDeleteSelection() {
return (
this.areAllSelectedActive ||
(HistoryFilters.checkFilter(this.filterText, "deleted", "any") && !this.areAllSelectedDeleted)
);
return this.areAllSelectedActive || (this.isAnyDeletedStateAllowed && !this.areAllSelectedDeleted);
},
/** @returns {Boolean} */
canUndeleteSelection() {
Expand Down Expand Up @@ -289,6 +280,12 @@ export default {
}
return true;
},
isAnyVisibilityAllowed() {
return HistoryFilters.checkFilter(this.filterText, "visible", "any");
},
isAnyDeletedStateAllowed() {
return HistoryFilters.checkFilter(this.filterText, "deleted", "any");
},
},
watch: {
hasSelection(newVal) {
Expand Down

0 comments on commit b7b5c05

Please sign in to comment.