mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Enable add/delete of Sieve scripts
This commit is contained in:
parent
1a07109d80
commit
ee37ad67bb
12 changed files with 24 additions and 22 deletions
|
|
@ -42,6 +42,11 @@ class SieveScriptPopupView extends AbstractViewNext {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (this.isNew() && SieveStore.scripts.find(item => item.name() === script.name())) {
|
||||
script.nameError(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
this.saving = true;
|
||||
this.saveError(false);
|
||||
|
||||
|
|
@ -51,6 +56,7 @@ class SieveScriptPopupView extends AbstractViewNext {
|
|||
|
||||
if (StorageResultType.Success === result && data && data.Result) {
|
||||
script.hasChanges(false);
|
||||
SieveStore.scripts.push(script);
|
||||
} else {
|
||||
this.saveError(true);
|
||||
this.saveErrorText((data && data.ErrorCode)
|
||||
|
|
@ -110,11 +116,10 @@ class SieveScriptPopupView extends AbstractViewNext {
|
|||
});
|
||||
}
|
||||
|
||||
onShow(oScript, fTrueCallback, bEdit) {
|
||||
this.fTrueCallback = fTrueCallback;
|
||||
onShow(oScript) {
|
||||
this.script(oScript);
|
||||
this.rawActive(!oScript.allowFilters());
|
||||
this.isNew(!bEdit);
|
||||
this.isNew(!oScript.name());
|
||||
this.saveError(false);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue