mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03: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) {
|
function typeCast(curValue, newValue) {
|
||||||
switch (typeof curValue)
|
switch (typeof curValue)
|
||||||
{
|
{
|
||||||
case 'boolean': return !!newValue;
|
case 'boolean': return 0 != newValue && !!newValue;
|
||||||
case 'number': return isFinite(newValue) ? parseFloat(newValue) : 0;
|
case 'number': return isFinite(newValue) ? parseFloat(newValue) : 0;
|
||||||
case 'string': return null != newValue ? '' + newValue : '';
|
case 'string': return null != newValue ? '' + newValue : '';
|
||||||
case 'object':
|
case 'object':
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ export class FilterModel extends AbstractModel {
|
||||||
return {
|
return {
|
||||||
// '@Object': 'Object/Filter',
|
// '@Object': 'Object/Filter',
|
||||||
ID: this.id,
|
ID: this.id,
|
||||||
Enabled: this.enabled() ? '1' : '0',
|
Enabled: this.enabled() ? 1 : 0,
|
||||||
Name: this.name(),
|
Name: this.name(),
|
||||||
Conditions: this.conditions.map(item => item.toJson()),
|
Conditions: this.conditions.map(item => item.toJson()),
|
||||||
ConditionsType: this.conditionsType(),
|
ConditionsType: this.conditionsType(),
|
||||||
|
|
@ -199,9 +199,9 @@ export class FilterModel extends AbstractModel {
|
||||||
ActionValueThird: this.actionValueThird(),
|
ActionValueThird: this.actionValueThird(),
|
||||||
ActionValueFourth: this.actionValueFourth(),
|
ActionValueFourth: this.actionValueFourth(),
|
||||||
|
|
||||||
Keep: this.actionKeep() ? '1' : '0',
|
Keep: this.actionKeep() ? 1 : 0,
|
||||||
Stop: this.actionNoStop() ? '0' : '1',
|
Stop: this.actionNoStop() ? 0 : 1,
|
||||||
MarkAsRead: this.actionMarkAsRead() ? '1' : '0'
|
MarkAsRead: this.actionMarkAsRead() ? 1 : 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -236,9 +236,9 @@ export class FilterModel extends AbstractModel {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
filter.actionNoStop(!json.Stop);
|
filter.actionKeep(1 == json.Keep);
|
||||||
filter.actionKeep(!!json.Keep);
|
filter.actionNoStop(0 == json.Stop);
|
||||||
filter.actionMarkAsRead(!!json.MarkAsRead);
|
filter.actionMarkAsRead(1 == json.MarkAsRead);
|
||||||
}
|
}
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue