mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
display empty action when invalid tag for client action
This commit is contained in:
@@ -117,17 +117,17 @@ export function actionManagerMixin<T extends ReturnType<typeof rpcMixin>>(
|
||||
descr: ClientActionDescription
|
||||
): Action["executor"] | undefined {
|
||||
let key = descr.tag;
|
||||
let Widget = this.actionRegistry.get(key);
|
||||
if (!Widget) {
|
||||
let ActionWidget = this.actionRegistry.get(key);
|
||||
if (!ActionWidget) {
|
||||
this.addNotification({
|
||||
title: "Invalid Client Action",
|
||||
type: "warning",
|
||||
message: `Cannot find widget '${key}' in the action registry`
|
||||
});
|
||||
return;
|
||||
ActionWidget = Widget;
|
||||
}
|
||||
return async function executor(this: Action, parent: Widget<any, any>) {
|
||||
const widget = new Widget!(parent, {});
|
||||
const widget = new ActionWidget!(parent, {});
|
||||
const div = document.createElement("div");
|
||||
await widget.mount(div);
|
||||
this.widget = widget;
|
||||
|
||||
@@ -24,9 +24,7 @@ export class Root extends Widget<Store, State> {
|
||||
}
|
||||
|
||||
mounted() {
|
||||
this.store.on("state_updated", this, newState => {
|
||||
this.updateState(newState);
|
||||
});
|
||||
this.store.on("state_updated", this, this.updateState);
|
||||
|
||||
// loading indicator
|
||||
this.store.on("rpc_status", this, status => {
|
||||
|
||||
Reference in New Issue
Block a user