From 17c0ce4c10c679f331244c73f34e6b90932c9a96 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Mon, 20 Feb 2017 18:47:19 +0100 Subject: [PATCH] Revert "Adds a reload button if the threema service says "error" #689" This reverts commit 2a214b8eb2fc0cb5c04ba49861b06fdb7261b1a5. --- app/store/ServicesList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/store/ServicesList.js b/app/store/ServicesList.js index 9de2c0d6..0fc5f699 100644 --- a/app/store/ServicesList.js +++ b/app/store/ServicesList.js @@ -686,7 +686,7 @@ Ext.define('Rambox.store.ServicesList', { description: 'Seriously secure messaging', url: 'https://web.threema.ch/', type: 'messaging', - js_unread: ' (function () { let unreadCount = 0; function checkUnread() { let newUnread = 0; try { let webClientService = angular.element(document.documentElement).injector().get(\'WebClientService\'); let conversations = webClientService.conversations.conversations; conversations.forEach(function(conversation) { newUnread += conversation.unreadCount; }); } catch (e) { } if (newUnread !== unreadCount) { unreadCount = newUnread; updateBadge(unreadCount); } } function updateBadge(count) { if (count && count >= 1) { rambox.setUnreadCount(count); } else { rambox.clearUnreadCount(); } } function checkConnectionError() { try { let webClientService = angular.element(document.documentElement).injector().get(\'WebClientService\'); let state = webClientService.state; if (state.state === \'error\') { addReloadButton(); } else { removeReloadButton(); } } catch (e) { } } function removeReloadButton() { let reloadButton = document.getElementById(\'rambox-reload-button\'); if (reloadButton !== null) { document.body.removeChild(reloadButton); } } function addReloadButton() { let reloadButton = document.getElementById(\'rambox-reload-button\'); if (reloadButton === null) { reloadButton = document.createElement(\'div\'); reloadButton.id = \'rambox-reload-button\'; reloadButton.style.position = \'fixed\'; reloadButton.style.top = \'20px\'; reloadButton.style.right = \'20px\'; reloadButton.style.padding = \'10px\'; reloadButton.style.backgroundColor = \'#fff\'; reloadButton.style.border = \'1px solid #ddd\'; reloadButton.style.borderRadius = \'2px\'; reloadButton.innerHTML = \'⟳ reload\'; document.body.appendChild(reloadButton); reloadButton.onclick = function() { window.location.reload(); } } } setInterval(checkUnread, 3000); setInterval(checkConnectionError, 3000); checkUnread(); })();', + js_unread: '(function () { let unreadCount = 0; function checkUnread() { let newUnread = 0; try { let webClientService = angular.element(document.documentElement).injector().get(\'WebClientService\'); let conversations = webClientService.conversations.conversations; conversations.forEach(function(conversation) { newUnread += conversation.unreadCount; }); } catch (e) { } if (newUnread !== unreadCount) { unreadCount = newUnread; updateBadge(unreadCount); } } function updateBadge(count) { if (count && count >= 1) { rambox.setUnreadCount(count); } else { rambox.clearUnreadCount(); } } setInterval(checkUnread, 3000); checkUnread(); })();', dont_update_unread_from_title: true }, {