Skip to content

reloadEditor is an async function #4772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master-mysterious-egg-next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions addons/html_builder/static/src/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ export class Builder extends Component {
editorBus.trigger("DOM_UPDATED");
}
},
reloadEditor: (param = {}) => {
this.props.reloadEditor({
reloadEditor: async (param = {}) => {
await this.props.reloadEditor({
initialTab: this.state.activeTab,
...param,
});
Expand Down
2 changes: 1 addition & 1 deletion addons/html_builder/static/src/core/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ function useOperationWithReload(callApply, reload) {
await Promise.all([callApply(...args), env.editor.shared.savePlugin.save()]);
const target = env.editor.shared["builder-options"].getReloadSelector(editingElement);
const url = reload.getReloadUrl?.();
env.editor.config.reloadEditor({ target, url });
await env.editor.config.reloadEditor({ target, url });
};
}
export function useInputBuilderComponent({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ export class AddFontDialog extends Component {
if (styleEl) {
delete styleEl.dataset.fontPreview;
}
this.props.reloadEditor();
await this.props.reloadEditor();
return true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions addons/website/static/src/builder/plugins/menu_data_plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export class MenuDataPlugin extends Plugin {
},
onClickEditMenu: () => {
this.services.dialog.add(EditMenuDialog, {
save: () => {
this.config.reloadEditor({ url: this.document.URL });
save: async () => {
await this.config.reloadEditor({ url: this.document.URL });
},
});
},
Expand Down