Skip to content
Snippets Groups Projects
Commit 1d025377 authored by Kautilya Tripathi's avatar Kautilya Tripathi Committed by Diego Sampaio
Browse files

[FIX] OTR dialog issue (#13755)

parent 408aa9d7
No related branches found
No related tags found
No related merge requests found
......@@ -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() {
......@@ -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',
......@@ -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',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment