Skip to content

Commit

Permalink
postmessage: Don't output error for handled UI message before ready
Browse files Browse the repository at this point in the history
Signed-off-by: Hubert Figuière <[email protected]>
Change-Id: Id357c54bce57464334a24115175087e4bbfa4aea
  • Loading branch information
hfiguiere authored and eszkadev committed Oct 26, 2023
1 parent 2485dab commit 83c490b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions browser/src/map/handler/Map.WOPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ L.Map.WOPI = L.Handler.extend({
}
var show = msg.MessageId === 'Show_Button';
this._map.uiManager.showButton(msg.Values.id, show);
return;
}
else if (msg.MessageId === 'Remove_Statusbar_Element') {
if (!msg.Values) {
Expand All @@ -287,18 +288,23 @@ L.Map.WOPI = L.Handler.extend({
return;
}
w2ui['actionbar'].remove(msg.Values.id);
return;
}
else if (msg.MessageId === 'Show_Menubar') {
this._map.uiManager.showMenubar();
return;
}
else if (msg.MessageId === 'Hide_Menubar') {
this._map.uiManager.hideMenubar();
return;
}
else if (msg.MessageId === 'Show_Ruler') {
this._map.uiManager.showRuler();
return;
}
else if (msg.MessageId === 'Hide_Ruler') {
this._map.uiManager.hideRuler();
return;
}
else if (msg.MessageId === 'Show_Menu_Item' || msg.MessageId === 'Hide_Menu_Item') {
if (!msg.Values) {
Expand All @@ -319,12 +325,15 @@ L.Map.WOPI = L.Handler.extend({
} else {
this._map.menubar.hideItem(msg.Values.id);
}
return;
}
else if (msg.MessageId === 'Insert_Button' &&
msg.Values && msg.Values.id && msg.Values.imgurl) {
this._map.uiManager.insertButton(msg.Values);
return;
} else if (msg.MessageId === 'Send_UNO_Command' && msg.Values && msg.Values.Command) {
this._map.sendUnoCommand(msg.Values.Command, msg.Values.Args || '');
return;
}
else if (msg.MessageId === 'Disable_Default_UIAction') {
// Disable the default handler and action for a UI command.
Expand All @@ -336,6 +345,7 @@ L.Map.WOPI = L.Handler.extend({
if (msg.Values && msg.Values.action && msg.Values.disable !== undefined) {
this._map._disableDefaultAction[msg.Values.action] = msg.Values.disable;
}
return;
}
else if (msg.MessageId === 'Error_Messages') {
if (msg.Values && msg.Values.list) {
Expand Down

0 comments on commit 83c490b

Please sign in to comment.