Make unread badge configurable
This commit is contained in:
@@ -484,7 +484,7 @@ var showUnreadBadgeWindows = function(unreadCount, mentionCount) {
|
||||
if (mentionCount > 0) {
|
||||
const dataURL = badge.createDataURL(mentionCount.toString());
|
||||
sendBadge(dataURL, 'You have unread mentions (' + mentionCount + ')');
|
||||
} else if (unreadCount > 0) {
|
||||
} else if (unreadCount > 0 && config.showUnreadBadge) {
|
||||
const dataURL = badge.createDataURL('•');
|
||||
sendBadge(dataURL, 'You have unread channels (' + unreadCount + ')');
|
||||
} else {
|
||||
@@ -495,7 +495,7 @@ var showUnreadBadgeWindows = function(unreadCount, mentionCount) {
|
||||
var showUnreadBadgeOSX = function(unreadCount, mentionCount) {
|
||||
if (mentionCount > 0) {
|
||||
remote.app.dock.setBadge(mentionCount.toString());
|
||||
} else if (unreadCount > 0) {
|
||||
} else if (unreadCount > 0 && config.showUnreadBadge) {
|
||||
remote.app.dock.setBadge('•');
|
||||
} else {
|
||||
remote.app.dock.setBadge('');
|
||||
@@ -531,7 +531,6 @@ var showUnreadBadge = function(unreadCount, mentionCount) {
|
||||
showUnreadBadgeOSX(unreadCount, mentionCount);
|
||||
break;
|
||||
case 'linux':
|
||||
console.log(unreadCount);
|
||||
showUnreadBadgeLinux(unreadCount, mentionCount);
|
||||
break;
|
||||
default:
|
||||
|
@@ -67,7 +67,8 @@ var SettingsPage = React.createClass({
|
||||
toggleWindowOnTrayIconClick: this.state.toggleWindowOnTrayIconClick,
|
||||
notifications: {
|
||||
flashWindow: this.state.notifications.flashWindow
|
||||
}
|
||||
},
|
||||
showUnreadBadge: this.state.showUnreadBadge
|
||||
};
|
||||
settings.writeFileSync(this.props.configFile, config);
|
||||
if (process.platform === 'win32' || process.platform === 'linux') {
|
||||
@@ -150,6 +151,11 @@ var SettingsPage = React.createClass({
|
||||
}
|
||||
});
|
||||
},
|
||||
handleShowUnreadBadge: function() {
|
||||
this.setState({
|
||||
showUnreadBadge: this.refs.showUnreadBadge.getChecked()
|
||||
});
|
||||
},
|
||||
render: function() {
|
||||
var teams_row = (
|
||||
<Row>
|
||||
@@ -192,6 +198,11 @@ var SettingsPage = React.createClass({
|
||||
checked={ this.state.toggleWindowOnTrayIconClick } onChange={ this.handleChangeToggleWindowOnTrayIconClick } />);
|
||||
}
|
||||
|
||||
if (process.platform === 'darwin' || process.platform === 'win32') {
|
||||
options.push(<Input key="inputShowUnreadBadge" id="inputShowUnreadBadge" ref="showUnreadBadge" type="checkbox" label="Show red badge on taskbar icon to indicate unread messages. Regardless of this setting, mentions are always indicated with a red badge and item count on the taskbar icon."
|
||||
checked={ this.state.showUnreadBadge } onChange={ this.handleShowUnreadBadge } />);
|
||||
}
|
||||
|
||||
var options_row = (options.length > 0) ? (
|
||||
<Row>
|
||||
<Col md={ 12 }>
|
||||
|
@@ -30,7 +30,8 @@ var loadDefault = function(version) {
|
||||
version: 1,
|
||||
notifications: {
|
||||
flashWindow: 0 // 0 = flash never, 1 = only when idle (after 10 seconds), 2 = always
|
||||
}
|
||||
},
|
||||
showUnreadBadge: true
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user