Skip to content

Commit

Permalink
Fix live chat issues: (#15473)
Browse files Browse the repository at this point in the history
- Agent filter on department form
 - Missing i18n keys
 - Random exceptions being thrown by livechat room.
  • Loading branch information
pierre-lehnen-rc authored and ggazzo committed Oct 18, 2019
1 parent aaa95a7 commit e5be2db
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app/livechat/client/views/app/tabbar/visitorHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ Template.visitorHistory.onCreated(function() {

this.autorun(() => {
const room = ChatRoom.findOne({ _id: Template.currentData().rid });
this.visitorId.set(room.v._id);
if (room) {
this.visitorId.set(room.v._id);
}
});

if (currentData && currentData.rid) {
Expand Down
2 changes: 1 addition & 1 deletion app/theme/client/imports/general/base_old.css
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ rc-old select,
}

.rc-old .-autocomplete-container {
top: auto !important;
top: auto;

width: 100%;

Expand Down
7 changes: 6 additions & 1 deletion app/ui/client/views/app/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -1223,13 +1223,18 @@ Template.room.onRendered(function() {
this.autorun(() => {
const subscription = Subscriptions.findOne({ rid }, { fields: { alert: 1, unread: 1 } });
readMessage.read();
return (subscription.alert || subscription.unread) && readMessage.refreshUnreadMark(rid);
return subscription && (subscription.alert || subscription.unread) && readMessage.refreshUnreadMark(rid);
});

this.autorun(() => {
const lastMessage = this.state.get('lastMessage');

const subscription = Subscriptions.findOne({ rid }, { fields: { ls: 1 } });
if (!subscription) {
this.unreadCount.set(0);
return;
}

const count = ChatMessage.find({ rid, ts: { $lte: lastMessage, $gt: subscription && subscription.ls } }).count();

this.unreadCount.set(count);
Expand Down
4 changes: 2 additions & 2 deletions packages/meteor-autocomplete/client/autocomplete-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default class AutoComplete {
this.position = settings.position || 'bottom';
this.rules = settings.rules;
this.selector = {
constainer: '.-autocomplete-container',
container: '.-autocomplete-container',
item: '.-autocomplete-item',
...settings.selector,
};
Expand Down Expand Up @@ -392,7 +392,7 @@ export default class AutoComplete {
positionContainer() {
// First render; Pick the first item and set css whenever list gets shown
let pos = {};
const element = this.tmplInst.$(this.selector.anchor || this.$element);
const element = this.selector.anchor ? this.tmplInst.$(this.selector.anchor) : this.$element;

if (this.position === 'fixed') {
const width = element.outerWidth();
Expand Down
3 changes: 3 additions & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
"Advocacy": "Advocacy",
"After_OAuth2_authentication_users_will_be_redirected_to_this_URL": "After OAuth2 authentication, users will be redirected to an URL on this list. You can add one URL per line.",
"Agent": "Agent",
"Agents": "Agents",
"Agent_added": "Agent added",
"Agent_removed": "Agent removed",
"Alerts": "Alerts",
Expand Down Expand Up @@ -1458,6 +1459,7 @@
"FileSize_KB": "__fileSize__ KB",
"FileSize_MB": "__fileSize__ MB",
"FileSize_Bytes": "__fileSize__ Bytes",
"Filter": "Filter",
"Financial_Services": "Financial Services",
"First_Channel_After_Login": "First Channel After Login",
"First_response_time": "First Response Time",
Expand Down Expand Up @@ -2046,6 +2048,7 @@
"manage-user-status_description": "Permission to manage the server custom user statuses",
"Manage_Apps": "Manage Apps",
"Manage_the_App": "Manage the App",
"Managers": "Managers",
"Manager_added": "Manager added",
"Manager_removed": "Manager removed",
"Managing_assets": "Managing assets",
Expand Down
3 changes: 3 additions & 0 deletions packages/rocketchat-i18n/i18n/pt-BR.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
"Advocacy": "Apoio dado",
"After_OAuth2_authentication_users_will_be_redirected_to_this_URL": "Após a autenticação OAuth2, os usuários serão redirecionados para esta URL",
"Agent": "Agente",
"Agents": "Agentes",
"Agent_added": "Agente adicionado",
"Agent_removed": "Agente removido",
"Alerts": "Alertas",
Expand Down Expand Up @@ -1379,6 +1380,7 @@
"FileSize_KB": "__fileSize__ KB",
"FileSize_MB": "__fileSize__ MB",
"FileSize_Bytes": "__fileSize__ Bytes",
"Filter": "Filtrar",
"Financial_Services": "Serviços financeiros",
"First_Channel_After_Login": "Primeiro canal após o login",
"First_response_time": "Primeiro tempo de resposta",
Expand Down Expand Up @@ -1919,6 +1921,7 @@
"manage-sounds_description": "Permissão para gerenciar os sons do servidor",
"Manage_Apps": "Gerenciar aplicativos",
"Manage_the_App": "Gerencie a aplicação",
"Managers": "Gerentes",
"Manager_added": "Gerente adicionado",
"Manager_removed": "Gerente removido",
"Managing_assets": "Gerenciando recursos",
Expand Down

0 comments on commit e5be2db

Please sign in to comment.