From 70d5320fc88909cc5cf52a68be7531c7ea54daa3 Mon Sep 17 00:00:00 2001 From: Arjun Nemani Date: Fri, 9 Mar 2018 21:01:20 +0530 Subject: [PATCH 1/2] Rocketchat-Highlight-Words: Fix Typo in comment Fixed typo `Hilights` to `Highlights` --- packages/rocketchat-highlight-words/client/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-highlight-words/client/client.js b/packages/rocketchat-highlight-words/client/client.js index aa3c6dc5c32b5..f2174eb38ca59 100644 --- a/packages/rocketchat-highlight-words/client/client.js +++ b/packages/rocketchat-highlight-words/client/client.js @@ -1,5 +1,5 @@ /* - * Hilights is a named function that will process Highlights + * Highlights is a named function that will process Highlights * @param {Object} message - The message object */ import _ from 'underscore'; From acb5952272d207c114dcc92fe45384624459a1c4 Mon Sep 17 00:00:00 2001 From: Arjun Nemani Date: Fri, 9 Mar 2018 21:46:15 +0530 Subject: [PATCH 2/2] Rocketchat-UI-Account: Fix split by comma. We were splitting the text only by newlines, this commit splits the text by both newlines and commas While joing again, we will join by both newline and comma. Fixes https://github.com/RocketChat/Rocket.Chat/issues/10077 --- packages/rocketchat-ui-account/client/accountPreferences.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rocketchat-ui-account/client/accountPreferences.js b/packages/rocketchat-ui-account/client/accountPreferences.js index 07487576d60f1..3466c05f4fb17 100644 --- a/packages/rocketchat-ui-account/client/accountPreferences.js +++ b/packages/rocketchat-ui-account/client/accountPreferences.js @@ -57,7 +57,7 @@ Template.accountPreferences.helpers({ }, highlights() { const userHighlights = RocketChat.getUserPreference(Meteor.user(), 'highlights'); - return userHighlights ? userHighlights.join('\n') : undefined; + return userHighlights ? userHighlights.join(',\n') : undefined; }, desktopNotificationEnabled() { return KonchatNotification.notificationStatus.get() === 'granted' || (window.Notification && Notification.permission === 'granted'); @@ -146,7 +146,7 @@ Template.accountPreferences.onCreated(function() { data.unreadAlert = JSON.parse($('#unreadAlert').find('input:checked').val()); data.notificationsSoundVolume = parseInt($('#notificationsSoundVolume').val()); data.roomCounterSidebar = JSON.parse($('#roomCounterSidebar').find('input:checked').val()); - data.highlights = _.compact(_.map($('[name=highlights]').val().split('\n'), function(e) { + data.highlights = _.compact(_.map($('[name=highlights]').val().split(/,|\n/), function(e) { return s.trim(e); }));