mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Bugfix: compose popup had two autosave timers
This commit is contained in:
parent
845483d127
commit
8157692a29
1 changed files with 18 additions and 41 deletions
|
|
@ -314,20 +314,6 @@ class ComposePopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
this.resizeObserver = new ResizeObserver(this.resizerTrigger.throttle(50).bind(this));
|
this.resizeObserver = new ResizeObserver(this.resizerTrigger.throttle(50).bind(this));
|
||||||
|
|
||||||
setInterval(() => {
|
|
||||||
if (
|
|
||||||
this.modalVisibility() &&
|
|
||||||
!FolderUserStore.draftFolderNotEnabled() &&
|
|
||||||
SettingsUserStore.allowDraftAutosave() &&
|
|
||||||
!this.isEmptyForm(false) &&
|
|
||||||
!this.saving() &&
|
|
||||||
!this.sending() &&
|
|
||||||
!this.savedError()
|
|
||||||
) {
|
|
||||||
this.saveCommand();
|
|
||||||
}
|
|
||||||
}, 120000);
|
|
||||||
|
|
||||||
decorateKoCommands(this, {
|
decorateKoCommands(this, {
|
||||||
sendCommand: self => self.canBeSentOrSaved(),
|
sendCommand: self => self.canBeSentOrSaved(),
|
||||||
saveCommand: self => self.canBeSentOrSaved(),
|
saveCommand: self => self.canBeSentOrSaved(),
|
||||||
|
|
@ -499,29 +485,22 @@ class ComposePopupView extends AbstractViewPopup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
autosaveFunction() {
|
autosaveStart() {
|
||||||
if (
|
clearTimeout(this.iTimer);
|
||||||
this.modalVisibility() &&
|
this.iTimer = setTimeout(()=>{
|
||||||
!FolderUserStore.draftFolderNotEnabled() &&
|
if (this.modalVisibility()
|
||||||
SettingsUserStore.allowDraftAutosave() &&
|
&& !FolderUserStore.draftFolderNotEnabled()
|
||||||
!this.isEmptyForm(false) &&
|
&& SettingsUserStore.allowDraftAutosave()
|
||||||
!this.saving() &&
|
&& !this.isEmptyForm(false)
|
||||||
!this.sending() &&
|
&& !this.saving()
|
||||||
!this.savedError()
|
&& !this.sending()
|
||||||
|
&& !this.savedError()
|
||||||
) {
|
) {
|
||||||
this.saveCommand();
|
this.saveCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.autosaveStart();
|
this.autosaveStart();
|
||||||
}
|
}, 60000);
|
||||||
|
|
||||||
autosaveStart() {
|
|
||||||
clearTimeout(this.iTimer);
|
|
||||||
this.iTimer = setTimeout(()=>this.autosaveFunction(), 60000);
|
|
||||||
}
|
|
||||||
|
|
||||||
autosaveStop() {
|
|
||||||
clearTimeout(this.iTimer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
emailsSource(oData, fResponse) {
|
emailsSource(oData, fResponse) {
|
||||||
|
|
@ -664,12 +643,12 @@ class ComposePopupView extends AbstractViewPopup {
|
||||||
}
|
}
|
||||||
|
|
||||||
onHide() {
|
onHide() {
|
||||||
this.autosaveStop();
|
// Stop autosave
|
||||||
|
clearTimeout(this.iTimer);
|
||||||
|
|
||||||
if (!this.bSkipNextHide) {
|
AppUserStore.composeInEdit(this.bSkipNextHide);
|
||||||
AppUserStore.composeInEdit(false);
|
|
||||||
this.reset();
|
this.bSkipNextHide || this.reset();
|
||||||
}
|
|
||||||
|
|
||||||
this.bSkipNextHide = false;
|
this.bSkipNextHide = false;
|
||||||
|
|
||||||
|
|
@ -822,8 +801,6 @@ class ComposePopupView extends AbstractViewPopup {
|
||||||
* @param {string=} sCustomPlainText = null
|
* @param {string=} sCustomPlainText = null
|
||||||
*/
|
*/
|
||||||
initOnShow(sType, oMessageOrArray, aToEmails, aCcEmails, aBccEmails, sCustomSubject, sCustomPlainText) {
|
initOnShow(sType, oMessageOrArray, aToEmails, aCcEmails, aBccEmails, sCustomSubject, sCustomPlainText) {
|
||||||
AppUserStore.composeInEdit(true);
|
|
||||||
|
|
||||||
let sFrom = '',
|
let sFrom = '',
|
||||||
sTo = '',
|
sTo = '',
|
||||||
sCc = '',
|
sCc = '',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue