mirror of
https://github.com/Mail-0/Zero.git
synced 2026-06-29 23:37:05 +00:00
shortcuts that work
This commit is contained in:
@@ -56,13 +56,13 @@ const globalShortcuts: Shortcut[] = [
|
||||
// description: 'Show keyboard shortcuts',
|
||||
// scope: 'global',
|
||||
// },
|
||||
{
|
||||
keys: ['z'],
|
||||
action: 'undoLastAction',
|
||||
type: 'single',
|
||||
description: 'Undo last action',
|
||||
scope: 'global',
|
||||
},
|
||||
// {
|
||||
// keys: ['z'],
|
||||
// action: 'undoLastAction',
|
||||
// type: 'single',
|
||||
// description: 'Undo last action',
|
||||
// scope: 'global',
|
||||
// },
|
||||
{
|
||||
keys: ['c'],
|
||||
action: 'newEmail',
|
||||
@@ -158,14 +158,14 @@ const mailListShortcuts: Shortcut[] = [
|
||||
// description: 'Delete email',
|
||||
// scope: 'mail-list',
|
||||
// },
|
||||
{
|
||||
keys: ['mod', 'a'],
|
||||
action: 'selectAll',
|
||||
type: 'combination',
|
||||
description: 'Select all emails',
|
||||
scope: 'mail-list',
|
||||
// preventDefault: true,
|
||||
},
|
||||
// {
|
||||
// keys: ['mod', 'a'],
|
||||
// action: 'selectAll',
|
||||
// type: 'combination',
|
||||
// description: 'Select all emails',
|
||||
// scope: 'mail-list',
|
||||
// preventDefault: true,
|
||||
// },
|
||||
];
|
||||
|
||||
const composeShortcuts: Shortcut[] = [
|
||||
|
||||
@@ -37,28 +37,23 @@ export function MailListHotkeys() {
|
||||
};
|
||||
}, []);
|
||||
|
||||
const selectAll = useCallback(
|
||||
(e: KeyboardEvent) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
console.log('selectAll');
|
||||
if (mail.bulkSelected.length > 0) {
|
||||
setMail((prev) => ({
|
||||
...prev,
|
||||
bulkSelected: [],
|
||||
}));
|
||||
} else if (items.length > 0) {
|
||||
const allIds = items.map((item) => item.id);
|
||||
setMail((prev) => ({
|
||||
...prev,
|
||||
bulkSelected: allIds,
|
||||
}));
|
||||
} else {
|
||||
toast.info(t('common.mail.noEmailsToSelect'));
|
||||
}
|
||||
},
|
||||
[items, mail.bulkSelected, setMail, t],
|
||||
);
|
||||
const selectAll = useCallback(() => {
|
||||
console.log('selectAll');
|
||||
if (mail.bulkSelected.length > 0) {
|
||||
setMail((prev) => ({
|
||||
...prev,
|
||||
bulkSelected: [],
|
||||
}));
|
||||
} else if (items.length > 0) {
|
||||
const allIds = items.map((item) => item.id);
|
||||
setMail((prev) => ({
|
||||
...prev,
|
||||
bulkSelected: allIds,
|
||||
}));
|
||||
} else {
|
||||
toast.info(t('common.mail.noEmailsToSelect'));
|
||||
}
|
||||
}, [items, mail.bulkSelected, setMail, t]);
|
||||
|
||||
const markAsRead = useCallback(() => {
|
||||
if (hoveredEmailId.current) {
|
||||
|
||||
Reference in New Issue
Block a user