aboutsummaryrefslogtreecommitdiffstats
path: root/src/models/News.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/models/News.ts')
-rw-r--r--src/models/News.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/models/News.ts b/src/models/News.ts
index 3db812937..d1ae6fcef 100644
--- a/src/models/News.ts
+++ b/src/models/News.ts
@@ -1,5 +1,7 @@
1// @flow 1// @flow
2 2
3import { ifUndefinedString, ifUndefinedBoolean } from '../jsUtils';
4
3interface INews { 5interface INews {
4 id: string; 6 id: string;
5 message: string; 7 message: string;
@@ -22,8 +24,8 @@ export default class News {
22 } 24 }
23 25
24 this.id = data.id; 26 this.id = data.id;
25 this.message = data.message || this.message; 27 this.message = ifUndefinedString(data.message, this.message);
26 this.type = data.type || this.type; 28 this.type = ifUndefinedString(data.type, this.type);
27 this.sticky = data.sticky !== undefined ? data.sticky : this.sticky; 29 this.sticky = ifUndefinedBoolean(data.sticky, this.sticky);
28 } 30 }
29} 31}