Sync mute state
This commit is contained in:
parent
15247e1c9a
commit
6c0acd09df
16 changed files with 236 additions and 61 deletions
|
@ -378,14 +378,24 @@ export class ConversationHeader extends React.Component<PropsType, StateType> {
|
|||
const muteOptions: Array<MuteOption> = [];
|
||||
if (isMuted(muteExpiresAt)) {
|
||||
const expires = moment(muteExpiresAt);
|
||||
const muteExpirationLabel = moment().isSame(expires, 'day')
|
||||
? expires.format('hh:mm A')
|
||||
: expires.format('M/D/YY, hh:mm A');
|
||||
|
||||
let muteExpirationLabel: string;
|
||||
if (Number(muteExpiresAt) >= Number.MAX_SAFE_INTEGER) {
|
||||
muteExpirationLabel = i18n('muteExpirationLabelAlways');
|
||||
} else {
|
||||
const muteExpirationUntil = moment().isSame(expires, 'day')
|
||||
? expires.format('hh:mm A')
|
||||
: expires.format('M/D/YY, hh:mm A');
|
||||
|
||||
muteExpirationLabel = i18n('muteExpirationLabel', [
|
||||
muteExpirationUntil,
|
||||
]);
|
||||
}
|
||||
|
||||
muteOptions.push(
|
||||
...[
|
||||
{
|
||||
name: i18n('muteExpirationLabel', [muteExpirationLabel]),
|
||||
name: muteExpirationLabel,
|
||||
disabled: true,
|
||||
value: 0,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue