aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorLibravatar Ricardo Cino <ricardo@cino.io>2022-11-28 16:53:04 +0100
committerLibravatar GitHub <noreply@github.com>2022-11-28 15:53:04 +0000
commitd5d685aaf4e796faf612c6d0fea0f0cc9ea49614 (patch)
tree72f027dc2d57f00c366d61570fd76ed6a0fcb27a /src/features
parent6.2.1-nightly.52 [skip ci] (diff)
downloadferdium-app-d5d685aaf4e796faf612c6d0fea0f0cc9ea49614.tar.gz
ferdium-app-d5d685aaf4e796faf612c6d0fea0f0cc9ea49614.tar.zst
ferdium-app-d5d685aaf4e796faf612c6d0fea0f0cc9ea49614.zip
fix: ensure default values are working for the all fields in all settings screens (#750)
Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
Diffstat (limited to 'src/features')
-rw-r--r--src/features/todos/store.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/features/todos/store.ts b/src/features/todos/store.ts
index 5cf5e1d75..bff099eb1 100644
--- a/src/features/todos/store.ts
+++ b/src/features/todos/store.ts
@@ -19,6 +19,7 @@ import Reaction, { createReactions } from '../../stores/lib/Reaction';
19import { createActionBindings } from '../utils/ActionBinding'; 19import { createActionBindings } from '../utils/ActionBinding';
20import { IPC, TODOS_ROUTES } from './constants'; 20import { IPC, TODOS_ROUTES } from './constants';
21import UserAgent from '../../models/UserAgent'; 21import UserAgent from '../../models/UserAgent';
22import { ifUndefined } from '../../jsUtils';
22 23
23const debug = require('../../preload-safe-debug')( 24const debug = require('../../preload-safe-debug')(
24 'Ferdium:feature:todos:store', 25 'Ferdium:feature:todos:store',
@@ -46,7 +47,7 @@ export default class TodoStore extends FeatureStore {
46 } 47 }
47 48
48 @computed get width() { 49 @computed get width() {
49 const width = this.settings.width || DEFAULT_TODOS_WIDTH; 50 const width = ifUndefined<number>(this.settings.width, DEFAULT_TODOS_WIDTH);
50 51
51 return width < TODOS_MIN_WIDTH ? TODOS_MIN_WIDTH : width; 52 return width < TODOS_MIN_WIDTH ? TODOS_MIN_WIDTH : width;
52 } 53 }
@@ -56,10 +57,10 @@ export default class TodoStore extends FeatureStore {
56 } 57 }
57 58
58 @computed get isTodosPanelVisible() { 59 @computed get isTodosPanelVisible() {
59 if (this.settings.isTodosPanelVisible === undefined) { 60 return ifUndefined<boolean>(
60 return DEFAULT_TODOS_VISIBLE; 61 this.settings.isTodosPanelVisible,
61 } 62 DEFAULT_TODOS_VISIBLE,
62 return this.settings.isTodosPanelVisible; 63 );
63 } 64 }
64 65
65 @computed get isFeatureEnabledByUser() { 66 @computed get isFeatureEnabledByUser() {