Skip to content

Commit

Permalink
Merge branch 'pu/cw/recordchanges' into '2024.11'
Browse files Browse the repository at this point in the history
fix(Tinebase) recordchange event in popup windows

See merge request tine20/tine20!5699
  • Loading branch information
corneliusweiss committed Jul 26, 2024
2 parents dd712c9 + dfadf3c commit f6f3db5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tine20/Tinebase/js/broadcastClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,14 @@ const init = async () => {
const topicPrefix = String(data.model).replace('_Model_', '.');
const topics = [`${topicPrefix}.*`, `${topicPrefix}.${data.recordId}`];

if (topics.filter(value => postal.subscriptions.recordchange.hasOwnProperty(value)).length) {
// NOTE: postal.subscriptions are per window, we run in main window only!
let subscriptions = Object.keys(postal.subscriptions.recordchange) || [];
Ext.ux.PopupWindowMgr.each((win) => {
if (_.isObject(_.get(win, 'popup.postal.subscriptions.recordchange'))) {
subscriptions = _.uniq(subscriptions.concat(Object.keys(win.popup.postal.subscriptions.recordchange) || []))
}
});
if (topics.filter(value => subscriptions.indexOf(value) >= 0)) {
if (! await isOwnEvent(data)) {
handleEvent(data);
}
Expand Down

0 comments on commit f6f3db5

Please sign in to comment.