This commit is contained in:
the-djmaze 2023-03-14 12:46:12 +01:00
parent 84c4522ff2
commit 8ea2ff4ae8
44 changed files with 87 additions and 18 deletions

View file

@ -3,7 +3,7 @@ import { koComputable, addObservablesTo, addComputablesTo } from 'External/ko';
import { SMAudio } from 'Common/Audio';
import { Notifications } from 'Common/Enums';
import { MessageSetAction } from 'Common/EnumsUser';
import { $htmlCL } from 'Common/Globals';
import { $htmlCL, fireEvent } from 'Common/Globals';
import { arrayLength, pString } from 'Common/Utils';
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
@ -413,6 +413,18 @@ MessagelistUserStore.removeMessagesFromList = (
} else {
MessagelistUserStore.isIncomplete(true);
// Select next email https://github.com/the-djmaze/snappymail/issues/968
if (currentMessage && 1 == messages.length && SettingsUserStore.showNextMessage()) {
let next = MessagelistUserStore.indexOf(currentMessage) + 1;
if (0 < next && (next = MessagelistUserStore()[next])) {
currentMessage = null;
fireEvent('mailbox.message.show', {
folder: next.folder,
uid: next.uid
});
}
}
messages.forEach(item => {
if (currentMessage && currentMessage.hash === item.hash) {
currentMessage = null;

View file

@ -26,6 +26,7 @@ export const SettingsUserStore = new class {
simpleAttachmentsList: 0,
useCheckboxesInList: 1,
listGrouped: 0,
showNextMessage: 0,
allowDraftAutosave: 1,
useThreads: 0,
replySameFolder: 0,
@ -95,6 +96,7 @@ export const SettingsUserStore = new class {
self.simpleAttachmentsList(SettingsGet('simpleAttachmentsList'));
self.useCheckboxesInList(SettingsGet('UseCheckboxesInList'));
self.listGrouped(SettingsGet('listGrouped'));
self.showNextMessage(SettingsGet('showNextMessage'));
self.allowDraftAutosave(SettingsGet('AllowDraftAutosave'));
self.useThreads(SettingsGet('UseThreads'));
self.replySameFolder(SettingsGet('ReplySameFolder'));