From 64f41454ad9a9b5b4732f128e92e2c5ebd1bf140 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 10 May 2024 12:01:02 +0200 Subject: [PATCH] FIX: uses getByIdentifier of d-menu (#611) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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`. --- .discourse-compatibility | 1 + .../connectors/post-text-buttons/ai-helper-options-menu.gjs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.discourse-compatibility b/.discourse-compatibility index 6f0292b2..370b7efb 100644 --- a/.discourse-compatibility +++ b/.discourse-compatibility @@ -1,3 +1,4 @@ +< 3.3.0.beta2-dev: 61890b667c06299841ae88946f84a112f00060e1 < 3.3.0.beta1-dev: a65c4076a63104b61d213534db7f89aa3c8acd9e < 3.2.0.beta5-dev: c70f43f130fb98e4a1adb1afd9b621aaa49088e3 < 3.2.0.beta4-dev: 493b48477a9288f2f1b6f021954088705a6673d6 diff --git a/assets/javascripts/discourse/connectors/post-text-buttons/ai-helper-options-menu.gjs b/assets/javascripts/discourse/connectors/post-text-buttons/ai-helper-options-menu.gjs index 8020b074..53dbf8c2 100644 --- a/assets/javascripts/discourse/connectors/post-text-buttons/ai-helper-options-menu.gjs +++ b/assets/javascripts/discourse/connectors/post-text-buttons/ai-helper-options-menu.gjs @@ -198,7 +198,11 @@ export default class AIHelperOptionsMenu extends Component { if (option.name === "explain") { 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`; this._activeAIRequest = ajax(fetchUrl, {