Browse Source

Update Slack icon fetching script

pull/2415/head
Ashvin 6 years ago
parent
commit
983b489d52
No known key found for this signature in database
GPG Key ID: 76E06C57362D66F5
  1. 2
      app/util/IconLoader.js
  2. 2
      app/ux/WebView.js

2
app/util/IconLoader.js

@ -19,7 +19,7 @@ Ext.define('Rambox.util.IconLoader', {
switch (service.type) {
case 'slack':
webview.executeJavaScript(
"(()=>{let a=document.querySelector('.team_icon');if(!a){const d=document.querySelector('#team_menu');d&&(d.click(),a=document.querySelector('.team_icon'))}if(!a)return!1;const{style:{backgroundImage:b}}=a,c=document.createEvent('MouseEvents');return c.initEvent('mousedown',!0,!0),document.querySelector('.client_channels_list_container').dispatchEvent(c),b.slice(5,-2)})();",
"(a=>window.slackDebug.activeTeam.redux.getState().teams[a].icon.image_44)(window.slackDebug.activeTeamId);",
false,
function (backgroundImage) {
if (backgroundImage) {

2
app/ux/WebView.js

@ -300,9 +300,7 @@ Ext.define('Rambox.ux.WebView',{
webview.setZoomLevel(me.record.get('zoomLevel'));
// Set special icon for some service (like Slack)
setTimeout(function() {
Rambox.util.IconLoader.loadServiceIconUrl(me, webview);
}, 1000);
});
// On search text

Loading…
Cancel
Save