diff --git a/apps/web/src/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete.tsx b/apps/web/src/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete.tsx index 6b5dfff955..363e4e9785 100644 --- a/apps/web/src/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete.tsx +++ b/apps/web/src/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete.tsx @@ -8,7 +8,6 @@ Please see LICENSE files in the repository root for full details. import React, { type JSX, type Ref, type FunctionComponent } from "react"; import { type FormattingFunctions, type MappedSuggestion } from "@vector-im/matrix-wysiwyg"; -import { logger } from "matrix-js-sdk/src/logger"; import Autocomplete from "../../Autocomplete"; import { type ICompletion } from "../../../../../autocomplete/Autocompleter"; @@ -111,8 +110,6 @@ const WysiwygAutocomplete = ({ if (!room) return null; const autoCompleteQuery = buildQuery(suggestion); - // debug for https://github.com/vector-im/element-web/issues/26037 - logger.log(`## 26037 ## Rendering Autocomplete for WysiwygAutocomplete with query: "${autoCompleteQuery}"`); // TODO - determine if we show all of the /command suggestions, there are some options in the // list which don't seem to make sense in this context, specifically /html and /plain diff --git a/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts b/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts index 2aae412eb7..d8f43a3390 100644 --- a/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts +++ b/apps/web/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts @@ -8,8 +8,7 @@ Please see LICENSE files in the repository root for full details. import { EMOTICON_TO_EMOJI } from "@matrix-org/emojibase-bindings"; import { type AllowedMentionAttributes, type MappedSuggestion } from "@vector-im/matrix-wysiwyg"; -import { type SyntheticEvent, useState, type SetStateAction } from "react"; -import { logger } from "matrix-js-sdk/src/logger"; +import { type SyntheticEvent, useState } from "react"; import { isNotNull } from "../../../../../Typeguards"; @@ -57,20 +56,7 @@ export function useSuggestion( onSelect: (event: SyntheticEvent) => void; suggestion: MappedSuggestion | null; } { - const [suggestionData, setSuggestionData0] = useState(null); - - // debug for https://github.com/vector-im/element-web/issues/26037 - const setSuggestionData = (suggestionData: SetStateAction): void => { - // setState allows either the data itself or a callback which returns the data - logger.log( - `## 26037 ## wysiwyg useSuggestion hook setting suggestion data to ${ - suggestionData === null || suggestionData instanceof Function - ? suggestionData - : suggestionData.mappedSuggestion.keyChar + suggestionData.mappedSuggestion.text - }`, - ); - setSuggestionData0(suggestionData); - }; + const [suggestionData, setSuggestionData] = useState(null); // We create a `selectionchange` handler here because we need to know when the user has moved the cursor, // we can not depend on input events only