Activate more Sieve extensions and use parseScript when saving script

This commit is contained in:
the-djmaze 2022-03-13 20:22:00 +01:00
parent 58f5e90f8f
commit 40adf992ed
9 changed files with 39 additions and 38 deletions

View file

@ -43,6 +43,9 @@ export class SieveScriptPopupView extends rl.pluginPopupView {
let self = this,
script = self.script();
if (!self.saving/* && script.hasChanges()*/) {
this.errorText('');
self.saveError(false);
if (!script.verify()) {
return;
}
@ -52,9 +55,14 @@ export class SieveScriptPopupView extends rl.pluginPopupView {
return;
}
try {
parseScript(this.script().body());
} catch (e) {
this.errorText(e.message);
return;
}
self.saving = true;
self.saveError(false);
self.errorText('');
if (self.allowToggle()) {
script.body(script.filtersToRaw());