UX: Hide the read indicator if read count is zero

This commit is contained in:
romanrizzi 2019-09-04 16:55:39 -03:00
parent 7a70fce584
commit f9ee6e923a
1 changed files with 3 additions and 4 deletions

View File

@ -69,15 +69,14 @@ registerButton("read-count", attrs => {
});
registerButton("read", attrs => {
const disabled = attrs.readCount === 0;
if (attrs.showReadIndicator) {
const readBySomeone = attrs.readCount > 0;
if (attrs.showReadIndicator && readBySomeone) {
return {
action: "toggleWhoRead",
title: "post.controls.read_indicator",
icon: "book-reader",
before: "read-count",
addContainer: false,
disabled
addContainer: false
};
}
});