FIX: uses getByIdentifier of d-menu (#611)

The menu service doesn’t implement an activeMenu property anymore as it can now support concurrent menus. The solution to this is to use `getByIdentifier`.
This commit is contained in:
Joffrey JAFFEUX 2024-05-10 12:01:02 +02:00 committed by GitHub
parent 61890b667c
commit 64f41454ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,4 @@
< 3.3.0.beta2-dev: 61890b667c06299841ae88946f84a112f00060e1
< 3.3.0.beta1-dev: a65c4076a63104b61d213534db7f89aa3c8acd9e < 3.3.0.beta1-dev: a65c4076a63104b61d213534db7f89aa3c8acd9e
< 3.2.0.beta5-dev: c70f43f130fb98e4a1adb1afd9b621aaa49088e3 < 3.2.0.beta5-dev: c70f43f130fb98e4a1adb1afd9b621aaa49088e3
< 3.2.0.beta4-dev: 493b48477a9288f2f1b6f021954088705a6673d6 < 3.2.0.beta4-dev: 493b48477a9288f2f1b6f021954088705a6673d6

View File

@ -198,7 +198,11 @@ export default class AIHelperOptionsMenu extends Component {
if (option.name === "explain") { if (option.name === "explain") {
this.menuState = this.MENU_STATES.result; this.menuState = this.MENU_STATES.result;
this.menu.activeMenu.options.placement = "bottom";
const menu = this.menu.getByIdentifier("post-text-selection-toolbar");
if (menu) {
menu.options.placement = "bottom";
}
const fetchUrl = `/discourse-ai/ai-helper/explain`; const fetchUrl = `/discourse-ai/ai-helper/explain`;
this._activeAIRequest = ajax(fetchUrl, { this._activeAIRequest = ajax(fetchUrl, {