Remove unused debug logs (#33354)
* Remove unused debug logs * Update WysiwygAutocomplete.tsx * Update useSuggestion.ts
This commit is contained in:
-3
@@ -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 React, { type JSX, type Ref, type FunctionComponent } from "react";
|
||||||
import { type FormattingFunctions, type MappedSuggestion } from "@vector-im/matrix-wysiwyg";
|
import { type FormattingFunctions, type MappedSuggestion } from "@vector-im/matrix-wysiwyg";
|
||||||
import { logger } from "matrix-js-sdk/src/logger";
|
|
||||||
|
|
||||||
import Autocomplete from "../../Autocomplete";
|
import Autocomplete from "../../Autocomplete";
|
||||||
import { type ICompletion } from "../../../../../autocomplete/Autocompleter";
|
import { type ICompletion } from "../../../../../autocomplete/Autocompleter";
|
||||||
@@ -111,8 +110,6 @@ const WysiwygAutocomplete = ({
|
|||||||
if (!room) return null;
|
if (!room) return null;
|
||||||
|
|
||||||
const autoCompleteQuery = buildQuery(suggestion);
|
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
|
// 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
|
// list which don't seem to make sense in this context, specifically /html and /plain
|
||||||
|
|||||||
@@ -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 { EMOTICON_TO_EMOJI } from "@matrix-org/emojibase-bindings";
|
||||||
import { type AllowedMentionAttributes, type MappedSuggestion } from "@vector-im/matrix-wysiwyg";
|
import { type AllowedMentionAttributes, type MappedSuggestion } from "@vector-im/matrix-wysiwyg";
|
||||||
import { type SyntheticEvent, useState, type SetStateAction } from "react";
|
import { type SyntheticEvent, useState } from "react";
|
||||||
import { logger } from "matrix-js-sdk/src/logger";
|
|
||||||
|
|
||||||
import { isNotNull } from "../../../../../Typeguards";
|
import { isNotNull } from "../../../../../Typeguards";
|
||||||
|
|
||||||
@@ -57,20 +56,7 @@ export function useSuggestion(
|
|||||||
onSelect: (event: SyntheticEvent<HTMLDivElement>) => void;
|
onSelect: (event: SyntheticEvent<HTMLDivElement>) => void;
|
||||||
suggestion: MappedSuggestion | null;
|
suggestion: MappedSuggestion | null;
|
||||||
} {
|
} {
|
||||||
const [suggestionData, setSuggestionData0] = useState<SuggestionState>(null);
|
const [suggestionData, setSuggestionData] = useState<SuggestionState>(null);
|
||||||
|
|
||||||
// debug for https://github.com/vector-im/element-web/issues/26037
|
|
||||||
const setSuggestionData = (suggestionData: SetStateAction<SuggestionState>): 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);
|
|
||||||
};
|
|
||||||
|
|
||||||
// We create a `selectionchange` handler here because we need to know when the user has moved the cursor,
|
// 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
|
// we can not depend on input events only
|
||||||
|
|||||||
Reference in New Issue
Block a user