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 => { registerButton("read", attrs => {
const disabled = attrs.readCount === 0; const readBySomeone = attrs.readCount > 0;
if (attrs.showReadIndicator) { if (attrs.showReadIndicator && readBySomeone) {
return { return {
action: "toggleWhoRead", action: "toggleWhoRead",
title: "post.controls.read_indicator", title: "post.controls.read_indicator",
icon: "book-reader", icon: "book-reader",
before: "read-count", before: "read-count",
addContainer: false, addContainer: false
disabled
}; };
} }
}); });