1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-10 09:22:25 +03:00

Add ability to properly edit messages in Threads. (#6877)

* Fix infinite rerender loop when editing message

* Refactor "edit_event" to Action.EditEvent

* Make up-arrow edit working in Threads

* Properly handle timeline events edit state

* Properly traverse messages to be edited

* Add MatrixClientContextHOC

* Refactor RoomContext to use AppRenderingContext

* Typescriptify test

Co-authored-by: Germain <germains@element.io>
This commit is contained in:
Dariusz Niemczyk
2021-10-01 15:35:54 +02:00
committed by GitHub
parent 5dede230f1
commit 1331e960fa
15 changed files with 403 additions and 189 deletions

View File

@@ -17,7 +17,7 @@
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import SettingsStore from "./settings/SettingsStore";
import { IState } from "./components/structures/RoomView";
import { IRoomState } from "./components/structures/RoomView";
interface IDiff {
isMemberEvent: boolean;
@@ -54,7 +54,7 @@ function memberEventDiff(ev: MatrixEvent): IDiff {
* @param ctx An optional RoomContext to pull cached settings values from to avoid
* hitting the settings store
*/
export default function shouldHideEvent(ev: MatrixEvent, ctx?: IState): boolean {
export default function shouldHideEvent(ev: MatrixEvent, ctx?: IRoomState): boolean {
// Accessing the settings store directly can be expensive if done frequently,
// so we should prefer using cached values if a RoomContext is available
const isEnabled = ctx ?