From 53a7fde9318621c287888974980a87401392cba4 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Thu, 17 Aug 2017 12:35:33 -0500 Subject: [PATCH] use proper object notation and rename isNewRepo to isNewRepoEnabled --- app/assets/javascripts/dispatcher.js | 4 ++-- .../javascripts/helpers/user_feature_helper.js | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index 7cc7636cca3..9098e0d1f46 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -408,7 +408,7 @@ import UserFeatureHelper from './helpers/user_feature_helper'; case 'projects:tree:show': shortcut_handler = new ShortcutsNavigation(); - if (UserFeatureHelper.isNewRepo()) break; + if (UserFeatureHelper.isNewRepoEnabled()) break; new TreeView(); new BlobViewer(); @@ -428,7 +428,7 @@ import UserFeatureHelper from './helpers/user_feature_helper'; shortcut_handler = true; break; case 'projects:blob:show': - if (UserFeatureHelper.isNewRepo()) break; + if (UserFeatureHelper.isNewRepoEnabled()) break; new BlobViewer(); initBlob(); break; diff --git a/app/assets/javascripts/helpers/user_feature_helper.js b/app/assets/javascripts/helpers/user_feature_helper.js index fcd8569819c..638118a5204 100644 --- a/app/assets/javascripts/helpers/user_feature_helper.js +++ b/app/assets/javascripts/helpers/user_feature_helper.js @@ -1,11 +1,7 @@ import Cookies from 'js-cookie'; -function isNewRepo() { - return Cookies.get('new_repo') === 'true'; -} - -const UserFeatureHelper = { - isNewRepo, +export default { + isNewRepoEnabled() { + return Cookies.get('new_repo') === 'true'; + }, }; - -export default UserFeatureHelper;