Browse Source

Revert "Adds a reload button if the threema service says "error" #689"

This reverts commit 2a214b8eb2.
pull/698/head
Michael Weimann 8 years ago
parent
commit
17c0ce4c10
  1. 2
      app/store/ServicesList.js

2
app/store/ServicesList.js

@ -686,7 +686,7 @@ Ext.define('Rambox.store.ServicesList', {
description: 'Seriously secure messaging', description: 'Seriously secure messaging',
url: 'https://web.threema.ch/', url: 'https://web.threema.ch/',
type: 'messaging', 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 dont_update_unread_from_title: true
}, },
{ {

Loading…
Cancel
Save