From e4899fa551d53ec07718659eed97178052982552 Mon Sep 17 00:00:00 2001
From: hmhealey <harrisonmhealey@gmail.com>
Date: Tue, 15 Dec 2015 11:36:14 -0500
Subject: Improved PreferenceStore api when getting values

---
 web/react/utils/utils.jsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'web/react/utils/utils.jsx')

diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index fb8b89252..b12ce5881 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -196,8 +196,8 @@ export function displayTime(ticks) {
         minutes = '0' + minutes;
     }
 
-    const useMilitaryTime = PreferenceStore.getPreference(Constants.Preferences.CATEGORY_DISPLAY_SETTINGS, 'use_military_time', {value: 'false'}).value;
-    if (useMilitaryTime === 'false') {
+    const useMilitaryTime = PreferenceStore.getBool(Constants.Preferences.CATEGORY_DISPLAY_SETTINGS, 'use_military_time');
+    if (!useMilitaryTime) {
         ampm = ' AM';
         if (hours >= 12) {
             ampm = ' PM';
@@ -1001,7 +1001,7 @@ export function getDisplayName(user) {
 
 export function displayUsername(userId) {
     const user = UserStore.getProfile(userId);
-    const nameFormat = PreferenceStore.getPreference(Constants.Preferences.CATEGORY_DISPLAY_SETTINGS, 'name_format', {value: 'false'}).value;
+    const nameFormat = PreferenceStore.get(Constants.Preferences.CATEGORY_DISPLAY_SETTINGS, 'name_format', 'false');
 
     let username = '';
     if (user) {
@@ -1253,7 +1253,7 @@ export function getPostTerm(post) {
 }
 
 export function isFeatureEnabled(feature) {
-    return PreferenceStore.getPreference(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, Constants.FeatureTogglePrefix + feature.label, {value: 'false'}).value === 'true';
+    return PreferenceStore.getBool(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, Constants.FeatureTogglePrefix + feature.label);
 }
 
 export function isSystemMessage(post) {
-- 
cgit v1.2.3-1-g7c22

