discourse/app/assets/javascripts/dialog-holder/addon/components/dialog-holder.js
2024-03-06 18:05:11 +01:00

17 lines
368 B
JavaScript

import Component from "@glimmer/component";
import { action } from "@ember/object";
import { service } from "@ember/service";
export default class DialogHolder extends Component {
@service dialog;
@action
async handleButtonAction(btn) {
if (btn.action && typeof btn.action === "function") {
await btn.action();
}
this.dialog.cancel();
}
}