electron_bridge: Notify electron app when org avatar is updated.

This commit is contained in:
Priyank 2018-03-20 17:28:48 +00:00 committed by Tim Abbott
parent 93f732406d
commit f0190fe0b8
2 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,7 @@
var noop = function () {};
set_global('document', 'document-stub');
set_global('window', {});
set_global('$', function () {
return {
trigger: noop,

View File

@ -105,6 +105,11 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
page_params.realm_icon_url = event.data.icon_url;
page_params.realm_icon_source = event.data.icon_source;
realm_icon.rerender();
var electron_bridge = window.electron_bridge;
if (electron_bridge !== undefined) {
electron_bridge.send_event('realm_icon_url', event.data.icon_url);
}
} else if (event.op === 'deactivated') {
window.location.href = "/accounts/deactivated/";
}