mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-28 11:24:11 +08:00
Able to select all unread and mark as read in one action (#2164)
This commit is contained in:
parent
7b80bc6155
commit
99f56a50e6
5 changed files with 28 additions and 0 deletions
|
@ -41,6 +41,7 @@ export default [
|
|||
['thread-list:select-unread', localized('Select all unread conversations')],
|
||||
['thread-list:select-starred', localized('Select all starred conversations')],
|
||||
['thread-list:select-unstarred', localized('Select all unstarred conversations')],
|
||||
['thread-list:select-unread-mark-as-read', localized('Select Unread and Mark as Read')],
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
@ -23,6 +23,8 @@ import {
|
|||
FocusedContentStore,
|
||||
FocusedPerspectiveStore,
|
||||
FolderSyncProgressStore,
|
||||
Thread,
|
||||
TaskFactory,
|
||||
} from 'mailspring-exports';
|
||||
|
||||
import * as ThreadListColumns from './thread-list-columns';
|
||||
|
@ -116,6 +118,7 @@ class ThreadList extends React.Component<{}, { style: string; syncing: boolean }
|
|||
'thread-list:select-unread': this._onSelectUnread,
|
||||
'thread-list:select-starred': this._onSelectStarred,
|
||||
'thread-list:select-unstarred': this._onSelectUnstarred,
|
||||
'thread-list:select-unread-mark-as-read': this._onSelectUnreadMarkAsRead,
|
||||
}}
|
||||
onDoubleClick={thread => Actions.popoutThread(thread)}
|
||||
onDragItems={this._onDragItems}
|
||||
|
@ -281,6 +284,24 @@ class ThreadList extends React.Component<{}, { style: string; syncing: boolean }
|
|||
const items = dataSource.itemsCurrentlyInViewMatching(item => !item.starred);
|
||||
this.refs.list.handler().onSelect(items);
|
||||
};
|
||||
|
||||
_onSelectUnreadMarkAsRead = () => {
|
||||
const dataSource = ThreadListStore.dataSource();
|
||||
const items = dataSource.itemsCurrentlyInViewMatching(item => item.unread) as Thread[];
|
||||
|
||||
if (items.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Actions.queueTask(
|
||||
TaskFactory.taskForSettingUnread({
|
||||
threads: items,
|
||||
unread: false,
|
||||
source: 'Toolbar Button: Thread List',
|
||||
})
|
||||
);
|
||||
Actions.popSheet();
|
||||
};
|
||||
}
|
||||
|
||||
export default ThreadList;
|
||||
|
|
|
@ -73,6 +73,8 @@ module.exports = {
|
|||
{ label: localized('Select All Starred'), command: 'thread-list:select-starred' },
|
||||
{ label: localized('Select All Unstarred'), command: 'thread-list:select-unstarred' },
|
||||
{ type: 'separator' },
|
||||
{ label: localized('Select Unread and Mark as Read'), command: 'thread-list:select-unread-mark-as-read' },
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: localized('Find'),
|
||||
submenu: [
|
||||
|
|
|
@ -41,6 +41,8 @@ module.exports = {
|
|||
{ label: localized('Select All Starred'), command: 'thread-list:select-starred' },
|
||||
{ label: localized('Select All Unstarred'), command: 'thread-list:select-unstarred' },
|
||||
{ type: 'separator' },
|
||||
{ label: localized('Select Unread and Mark as Read'), command: 'thread-list:select-unread-mark-as-read' },
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: localized('Find'),
|
||||
submenu: [
|
||||
|
|
|
@ -20,6 +20,8 @@ module.exports = {
|
|||
{ label: localized('Select All Starred'), command: 'thread-list:select-starred' },
|
||||
{ label: localized('Select All Unstarred'), command: 'thread-list:select-unstarred' },
|
||||
{ type: 'separator' },
|
||||
{ label: localized('Select Unread and Mark as Read'), command: 'thread-list:select-unread-mark-as-read' },
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: localized('Find'),
|
||||
submenu: [
|
||||
|
|
Loading…
Reference in a new issue