mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-27 19:19:21 +03:00
Better Sieve rainloop.user script handling
This commit is contained in:
parent
f080a302b1
commit
4cfd6479ce
51 changed files with 92 additions and 99 deletions
|
|
@ -82,11 +82,9 @@ export class AbstractModel {
|
|||
}
|
||||
|
||||
revivePropertiesFromJson(json) {
|
||||
let model = this.constructor;
|
||||
if (!model.validJson(json)) {
|
||||
return false;
|
||||
}
|
||||
forEachObjectEntry(json, (key, value) => {
|
||||
const model = this.constructor,
|
||||
valid = model.validJson(json);
|
||||
valid && forEachObjectEntry(json, (key, value) => {
|
||||
if ('@' !== key[0]) try {
|
||||
key = key[0].toLowerCase() + key.slice(1);
|
||||
switch (typeof this[key])
|
||||
|
|
@ -104,9 +102,12 @@ export class AbstractModel {
|
|||
case 'string':
|
||||
this[key] = typeCast(this[key], value);
|
||||
break;
|
||||
// fall through
|
||||
case 'undefined':
|
||||
default:
|
||||
console.log(`Undefined ${model.name}.${key} not set`);
|
||||
// this[key] = value;
|
||||
break;
|
||||
// default:
|
||||
// console.log((typeof this[key])+` ${model.name}.${key} not revived`);
|
||||
// console.log((typeof this[key])+' '+(model.name)+'.'+key+' not revived');
|
||||
}
|
||||
} catch (e) {
|
||||
|
|
@ -114,7 +115,7 @@ export class AbstractModel {
|
|||
console.error(e);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
return valid;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue