Skip to content

Commit

Permalink
[FIX] OTR dialog issue (#13755)
Browse files Browse the repository at this point in the history
  • Loading branch information
knrt10 authored and sampaiodiego committed Apr 1, 2019
1 parent 408aa9d commit 1d02537
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/otr/client/views/otrFlexTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { OTR } from '../rocketchat.otr';
import { modal } from '../../../ui-utils';
import { t } from '../../../utils';

Template.otrFlexTab.helpers({
otrAvailable() {
Expand Down Expand Up @@ -33,12 +34,12 @@ Template.otrFlexTab.helpers({
});

Template.otrFlexTab.events({
'click button.start'(e, t) {
'click button.start'(e, instance) {
e.preventDefault();
const otr = OTR.getInstanceByRoomId(this.rid);
if (otr) {
otr.handshake();
t.timeout = Meteor.setTimeout(() => {
instance.timeout = Meteor.setTimeout(() => {
modal.open({
title: t('Timeout'),
type: 'error',
Expand All @@ -48,13 +49,13 @@ Template.otrFlexTab.events({
}, 10000);
}
},
'click button.refresh'(e, t) {
'click button.refresh'(e, instance) {
e.preventDefault();
const otr = OTR.getInstanceByRoomId(this.rid);
if (otr) {
otr.reset();
otr.handshake(true);
t.timeout = Meteor.setTimeout(() => {
instance.timeout = Meteor.setTimeout(() => {
modal.open({
title: t('Timeout'),
type: 'error',
Expand Down

0 comments on commit 1d02537

Please sign in to comment.