diff options
author | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-09-04 20:39:08 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-04 20:39:08 +0530 |
commit | 41982633c10c7c155918263b413fe86657e3722b (patch) | |
tree | f6821cc62969fecf1efdf5946318a11721ed0f99 /src/models/News.ts | |
parent | chore: remove what's new functionality (#1864) (diff) | |
download | ferdium-app-41982633c10c7c155918263b413fe86657e3722b.tar.gz ferdium-app-41982633c10c7c155918263b413fe86657e3722b.tar.zst ferdium-app-41982633c10c7c155918263b413fe86657e3722b.zip |
Refactoring to have consistent usage (prep for ts conversion) (#1821)
Diffstat (limited to 'src/models/News.ts')
-rw-r--r-- | src/models/News.ts | 8 |
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 | ||
3 | import { ifUndefinedString, ifUndefinedBoolean } from '../jsUtils'; | ||
4 | |||
3 | interface INews { | 5 | interface 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 | } |