From 012bd882587d6463b7138bb1cb1843d95b76fe5c Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Thu, 19 Dec 2019 22:16:01 +0100 Subject: [PATCH] Change layout and autoconnect behaviour. Add info next to topt function --- index.html | 24 ++++++++++++++++-------- js/connection.js | 8 +++++++- js/glowingbear.js | 5 ++--- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index 3da29a8..e66f13c 100644 --- a/index.html +++ b/index.html @@ -100,21 +100,31 @@
diff --git a/js/connection.js b/js/connection.js index d84ac76..b521332 100644 --- a/js/connection.js +++ b/js/connection.js @@ -328,9 +328,15 @@ weechat.factory('connection', }; var attemptReconnect = function (bufferId, timeout) { + // won't work if totp is mandatory + if (settings.useTotp) + { + $log.info('Not reconnecting because totp will be expired.'); + return; + } + $log.info('Attempting to reconnect...'); var d = connectionData; - // won't work if totp is mandatory connect(d[0], d[1], d[2], d[3], d[4], false, "", function() { $rootScope.reconnecting = false; // on success, update active buffer diff --git a/js/glowingbear.js b/js/glowingbear.js index a139787..d85114c 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -688,12 +688,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', } }; - $scope.changeUseTOTP = function() { + settings.addCallback('useTotp', function() { if (settings.useTotp) { settings.autoconnect = false; } - }; - + }); $scope.connect = function() { notifications.requestNotificationPermission();