Merge remote-tracking branch 'origin/develop' into jryans/4s-new-key-backup
This commit is contained in:
commit
c6e56d98b3
59 changed files with 1164 additions and 371 deletions
|
@ -29,6 +29,7 @@ import {
|
|||
} from '../../../notifications';
|
||||
import SdkConfig from "../../../SdkConfig";
|
||||
import LabelledToggleSwitch from "../elements/LabelledToggleSwitch";
|
||||
import AccessibleButton from "../elements/AccessibleButton";
|
||||
|
||||
// TODO: this "view" component still has far too much application logic in it,
|
||||
// which should be factored out to other files.
|
||||
|
@ -654,6 +655,17 @@ module.exports = createReactClass({
|
|||
MatrixClientPeg.get().getThreePids().then((r) => this.setState({threepids: r.threepids}));
|
||||
},
|
||||
|
||||
_onClearNotifications: function() {
|
||||
const cli = MatrixClientPeg.get();
|
||||
|
||||
cli.getRooms().forEach(r => {
|
||||
if (r.getUnreadNotificationCount() > 0) {
|
||||
const events = r.getLiveTimeline().getEvents();
|
||||
if (events.length) cli.sendReadReceipt(events.pop());
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
_updatePushRuleActions: function(rule, actions, enabled) {
|
||||
const cli = MatrixClientPeg.get();
|
||||
|
||||
|
@ -746,6 +758,13 @@ module.exports = createReactClass({
|
|||
label={_t('Enable notifications for this account')}/>;
|
||||
}
|
||||
|
||||
let clearNotificationsButton;
|
||||
if (MatrixClientPeg.get().getRooms().some(r => r.getUnreadNotificationCount() > 0)) {
|
||||
clearNotificationsButton = <AccessibleButton onClick={this._onClearNotifications} kind='danger'>
|
||||
{_t("Clear notifications")}
|
||||
</AccessibleButton>;
|
||||
}
|
||||
|
||||
// When enabled, the master rule inhibits all existing rules
|
||||
// So do not show all notification settings
|
||||
if (this.state.masterPushRule && this.state.masterPushRule.enabled) {
|
||||
|
@ -756,6 +775,8 @@ module.exports = createReactClass({
|
|||
<div className="mx_UserNotifSettings_notifTable">
|
||||
{ _t('All notifications are currently disabled for all targets.') }
|
||||
</div>
|
||||
|
||||
{clearNotificationsButton}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -877,6 +898,7 @@ module.exports = createReactClass({
|
|||
|
||||
{ devicesSection }
|
||||
|
||||
{ clearNotificationsButton }
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -49,6 +49,17 @@ export default class LabsUserSettingsTab extends React.Component {
|
|||
return (
|
||||
<div className="mx_SettingsTab">
|
||||
<div className="mx_SettingsTab_heading">{_t("Labs")}</div>
|
||||
<div className='mx_SettingsTab_subsectionText'>
|
||||
{
|
||||
_t('Customise your experience with experimental labs features. ' +
|
||||
'<a>Learn more</a>.', {}, {
|
||||
'a': (sub) => {
|
||||
return <a href="https://github.com/vector-im/riot-web/blob/develop/docs/labs.md"
|
||||
rel='noopener' target='_blank'>{sub}</a>;
|
||||
},
|
||||
})
|
||||
}
|
||||
</div>
|
||||
<div className="mx_SettingsTab_section">
|
||||
{flags}
|
||||
<SettingsFlag name={"enableWidgetScreenshots"} level={SettingLevel.ACCOUNT} />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue