mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-24 23:08:08 +08:00
Resolved Issue #60
This commit is contained in:
parent
9c14ba1b9d
commit
6d16a533fe
2 changed files with 8 additions and 8 deletions
|
@ -8,7 +8,7 @@ function dispose(disposable) {
|
|||
function typeCast(curValue, newValue) {
|
||||
switch (typeof curValue)
|
||||
{
|
||||
case 'boolean': return !!newValue;
|
||||
case 'boolean': return 0 != newValue && !!newValue;
|
||||
case 'number': return isFinite(newValue) ? parseFloat(newValue) : 0;
|
||||
case 'string': return null != newValue ? '' + newValue : '';
|
||||
case 'object':
|
||||
|
|
|
@ -188,7 +188,7 @@ export class FilterModel extends AbstractModel {
|
|||
return {
|
||||
// '@Object': 'Object/Filter',
|
||||
ID: this.id,
|
||||
Enabled: this.enabled() ? '1' : '0',
|
||||
Enabled: this.enabled() ? 1 : 0,
|
||||
Name: this.name(),
|
||||
Conditions: this.conditions.map(item => item.toJson()),
|
||||
ConditionsType: this.conditionsType(),
|
||||
|
@ -199,9 +199,9 @@ export class FilterModel extends AbstractModel {
|
|||
ActionValueThird: this.actionValueThird(),
|
||||
ActionValueFourth: this.actionValueFourth(),
|
||||
|
||||
Keep: this.actionKeep() ? '1' : '0',
|
||||
Stop: this.actionNoStop() ? '0' : '1',
|
||||
MarkAsRead: this.actionMarkAsRead() ? '1' : '0'
|
||||
Keep: this.actionKeep() ? 1 : 0,
|
||||
Stop: this.actionNoStop() ? 0 : 1,
|
||||
MarkAsRead: this.actionMarkAsRead() ? 1 : 0
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -236,9 +236,9 @@ export class FilterModel extends AbstractModel {
|
|||
);
|
||||
}
|
||||
|
||||
filter.actionNoStop(!json.Stop);
|
||||
filter.actionKeep(!!json.Keep);
|
||||
filter.actionMarkAsRead(!!json.MarkAsRead);
|
||||
filter.actionKeep(1 == json.Keep);
|
||||
filter.actionNoStop(0 == json.Stop);
|
||||
filter.actionMarkAsRead(1 == json.MarkAsRead);
|
||||
}
|
||||
return filter;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue