mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Moved AllowDraftAutosave option from Settings -> Security to Settings -> General -> Compose
This commit is contained in:
parent
edcb84b4ae
commit
03379a6163
43 changed files with 93 additions and 110 deletions
|
|
@ -44,7 +44,7 @@ export class UserSettingsGeneral extends AbstractViewSettings {
|
|||
|
||||
['layout', 'messageReadDelay', 'messagesPerPage', 'checkMailInterval',
|
||||
'editorDefaultType', 'requestReadReceipt', 'requestDsn', 'requireTLS', 'pgpSign', 'pgpEncrypt',
|
||||
'viewHTML', 'viewImages', 'viewImagesWhitelist', 'removeColors', 'allowStyles',
|
||||
'viewHTML', 'viewImages', 'viewImagesWhitelist', 'removeColors', 'allowStyles', 'allowDraftAutosave',
|
||||
'hideDeleted', 'listInlineAttachments', 'simpleAttachmentsList', 'collapseBlockquotes', 'maxBlockquotesLevel',
|
||||
'useCheckboxesInList', 'listGrouped', 'useThreads', 'replySameFolder', 'msgDefaultAction', 'allowSpellcheck'
|
||||
].forEach(name => this[name] = SettingsUserStore[name]);
|
||||
|
|
@ -105,7 +105,7 @@ export class UserSettingsGeneral extends AbstractViewSettings {
|
|||
this.addSettings(['ViewHTML', 'ViewImages', 'ViewImagesWhitelist', 'HideDeleted', 'AllowStyles',
|
||||
'ListInlineAttachments', 'simpleAttachmentsList', 'UseCheckboxesInList', 'listGrouped', 'ReplySameFolder',
|
||||
'requestReadReceipt', 'requestDsn', 'requireTLS', 'pgpSign', 'pgpEncrypt', 'allowSpellcheck',
|
||||
'DesktopNotifications', 'SoundNotification', 'CollapseBlockquotes']);
|
||||
'DesktopNotifications', 'SoundNotification', 'CollapseBlockquotes', 'AllowDraftAutosave']);
|
||||
|
||||
const fReloadLanguageHelper = (saveSettingsStep) => () => {
|
||||
this.languageTrigger(saveSettingsStep);
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ import { SettingsUserStore } from 'Stores/User/Settings';
|
|||
import { GnuPGUserStore } from 'Stores/User/GnuPG';
|
||||
import { OpenPGPUserStore } from 'Stores/User/OpenPGP';
|
||||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
|
||||
import { OpenPgpImportPopupView } from 'View/Popup/OpenPgpImport';
|
||||
|
|
@ -46,10 +44,6 @@ export class UserSettingsSecurity extends AbstractViewSettings {
|
|||
this.canOpenPGP = SettingsCapa('OpenPGP');
|
||||
this.canGnuPG = GnuPGUserStore.isSupported();
|
||||
this.canMailvelope = !!window.mailvelope;
|
||||
|
||||
this.allowDraftAutosave = SettingsUserStore.allowDraftAutosave;
|
||||
|
||||
this.allowDraftAutosave.subscribe(value => Remote.saveSetting('AllowDraftAutosave', value))
|
||||
}
|
||||
|
||||
addOpenPgpKey() {
|
||||
|
|
|
|||
|
|
@ -492,57 +492,59 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
saveCommand() {
|
||||
if (FolderUserStore.draftsFolderNotEnabled()) {
|
||||
showScreenPopup(FolderSystemPopupView, [FolderType.Drafts]);
|
||||
} else {
|
||||
this.savedError(false);
|
||||
this.saving(true);
|
||||
this.autosaveStart();
|
||||
this.getMessageRequestParams(FolderUserStore.draftsFolder(), 1).then(params => {
|
||||
Remote.request('SaveMessage',
|
||||
(iError, oData) => {
|
||||
let result = false;
|
||||
if (!this.saving() && !this.sending()) {
|
||||
if (FolderUserStore.draftsFolderNotEnabled()) {
|
||||
showScreenPopup(FolderSystemPopupView, [FolderType.Drafts]);
|
||||
} else {
|
||||
this.savedError(false);
|
||||
this.saving(true);
|
||||
this.autosaveStart();
|
||||
this.getMessageRequestParams(FolderUserStore.draftsFolder(), 1).then(params => {
|
||||
Remote.request('SaveMessage',
|
||||
(iError, oData) => {
|
||||
let result = false;
|
||||
|
||||
this.saving(false);
|
||||
this.saving(false);
|
||||
|
||||
if (!iError) {
|
||||
if (oData.Result.folder && oData.Result.uid) {
|
||||
result = true;
|
||||
if (!iError) {
|
||||
if (oData.Result.folder && oData.Result.uid) {
|
||||
result = true;
|
||||
|
||||
if (this.bFromDraft) {
|
||||
const message = MessageUserStore.message();
|
||||
if (message && this.draftsFolder() === message.folder && this.draftUid() == message.uid) {
|
||||
MessageUserStore.message(null);
|
||||
if (this.bFromDraft) {
|
||||
const message = MessageUserStore.message();
|
||||
if (message && this.draftsFolder() === message.folder && this.draftUid() == message.uid) {
|
||||
MessageUserStore.message(null);
|
||||
}
|
||||
}
|
||||
|
||||
this.draftsFolder(oData.Result.folder);
|
||||
this.draftUid(oData.Result.uid);
|
||||
|
||||
this.savedTime(new Date);
|
||||
|
||||
if (this.bFromDraft) {
|
||||
setFolderHash(this.draftsFolder(), '');
|
||||
}
|
||||
setFolderHash(FolderUserStore.draftsFolder(), '');
|
||||
}
|
||||
|
||||
this.draftsFolder(oData.Result.folder);
|
||||
this.draftUid(oData.Result.uid);
|
||||
|
||||
this.savedTime(new Date);
|
||||
|
||||
if (this.bFromDraft) {
|
||||
setFolderHash(this.draftsFolder(), '');
|
||||
}
|
||||
setFolderHash(FolderUserStore.draftsFolder(), '');
|
||||
}
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
this.savedError(true);
|
||||
this.savedErrorDesc(getNotification(Notification.CantSaveMessage));
|
||||
}
|
||||
if (!result) {
|
||||
this.savedError(true);
|
||||
this.savedErrorDesc(getNotification(Notification.CantSaveMessage));
|
||||
}
|
||||
|
||||
reloadDraftFolder();
|
||||
},
|
||||
params,
|
||||
200000
|
||||
);
|
||||
}).catch(e => {
|
||||
this.saving(false);
|
||||
this.savedError(true);
|
||||
this.savedErrorDesc(getNotification(Notification.CantSaveMessage) + ': ' + e);
|
||||
});
|
||||
reloadDraftFolder();
|
||||
},
|
||||
params,
|
||||
200000
|
||||
);
|
||||
}).catch(e => {
|
||||
this.saving(false);
|
||||
this.savedError(true);
|
||||
this.savedErrorDesc(getNotification(Notification.CantSaveMessage) + ': ' + e);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -569,12 +571,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
skipCommand() {
|
||||
ComposePopupView.inEdit(true);
|
||||
|
||||
if (
|
||||
!this.saving() &&
|
||||
!this.sending() &&
|
||||
!FolderUserStore.draftsFolderNotEnabled() &&
|
||||
SettingsUserStore.allowDraftAutosave()
|
||||
) {
|
||||
if (!FolderUserStore.draftsFolderNotEnabled() && SettingsUserStore.allowDraftAutosave()) {
|
||||
this.saveCommand();
|
||||
}
|
||||
|
||||
|
|
@ -597,8 +594,6 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
&& !FolderUserStore.draftsFolderNotEnabled()
|
||||
&& SettingsUserStore.allowDraftAutosave()
|
||||
&& !this.isEmptyForm(false)
|
||||
&& !this.saving()
|
||||
&& !this.sending()
|
||||
&& !this.savedError()
|
||||
) {
|
||||
this.saveCommand();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue