Don't notify when context was not changed

this will save some work on invalidating toolbars

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2d20a2a490c99ff9e4b1852d551b4d3ec37abd1c
This commit is contained in:
Szymon Kłos 2024-06-24 10:37:29 +02:00 committed by Szymon Kłos
parent d21caf6937
commit e3498c4ff6

View file

@ -1498,8 +1498,14 @@ L.CanvasTileLayer = L.Layer.extend({
message = message.split(' ');
if (message.length > 1) {
var old = this._map.context || {};
this._map.context = {appId: message[0], context: message[1]};
this._map.fire('contextchange', {appId: message[0], context: message[1], oldAppId: old.appId, oldContext: old.context});
var newContext = {appId: message[0], context: message[1]};
if (old.appId !== newContext.appId || old.context !== newContext.context) {
this._map.context = newContext;
this._map.fire('contextchange', {
appId: newContext.appId, context: newContext.context,
oldAppId: old.appId, oldContext: old.context
});
}
}
}
else if (textMsg.startsWith('formfieldbutton:')) {