From ec4650c60dd0f20f7954236a7457aaa8a61ee1fc Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 16 Sep 2021 11:23:41 +0100 Subject: [PATCH 1/5] Fix abuse of MainSplit in LegacyCommunityPreview --- src/components/structures/LegacyCommunityPreview.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/structures/LegacyCommunityPreview.tsx b/src/components/structures/LegacyCommunityPreview.tsx index 92aea8bb7d..32bafeb3fa 100644 --- a/src/components/structures/LegacyCommunityPreview.tsx +++ b/src/components/structures/LegacyCommunityPreview.tsx @@ -28,7 +28,6 @@ import { linkifyElement } from "../../HtmlUtils"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { Action } from "../../dispatcher/actions"; import { UserTab } from "../views/dialogs/UserSettingsDialog"; -import MainSplit from './MainSplit'; interface IProps { groupId: string; @@ -49,11 +48,11 @@ const LegacyCommunityPreview = ({ groupId }: IProps) => { if (!groupSummary) { return
- +
- +
; } @@ -70,7 +69,7 @@ const LegacyCommunityPreview = ({ groupId }: IProps) => { return
- +
{ }
-
+
; }; From f7d8ae2b1340b1dd9618b92e1b971e3c201c4840 Mon Sep 17 00:00:00 2001 From: Dariusz Niemczyk Date: Thu, 16 Sep 2021 15:21:40 +0200 Subject: [PATCH 2/5] Fix invalid accessor for method. --- src/components/structures/EmbeddedPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/EmbeddedPage.tsx b/src/components/structures/EmbeddedPage.tsx index 07c14475f2..ec37eab254 100644 --- a/src/components/structures/EmbeddedPage.tsx +++ b/src/components/structures/EmbeddedPage.tsx @@ -55,7 +55,7 @@ export default class EmbeddedPage extends React.PureComponent { }; } - private translate(s: string): string { + protected translate(s: string): string { // default implementation - skins may wish to extend this return sanitizeHtml(_t(s)); } From 78587558d8fb4bbab3fb954900897b2362bfd01a Mon Sep 17 00:00:00 2001 From: Dariusz Niemczyk Date: Thu, 16 Sep 2021 16:02:06 +0200 Subject: [PATCH 3/5] Transcriptify thread events a bit --- src/components/structures/ThreadPanel.tsx | 10 +++++----- src/components/structures/ThreadView.tsx | 10 +++++----- src/components/views/rooms/EventTile.tsx | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/structures/ThreadPanel.tsx b/src/components/structures/ThreadPanel.tsx index a0bccfdce9..d9fd155c07 100644 --- a/src/components/structures/ThreadPanel.tsx +++ b/src/components/structures/ThreadPanel.tsx @@ -16,7 +16,7 @@ limitations under the License. import React from 'react'; import { MatrixEvent, Room } from 'matrix-js-sdk/src'; -import { Thread } from 'matrix-js-sdk/src/models/thread'; +import { Thread, THREAD_EVENTS } from 'matrix-js-sdk/src/models/thread'; import BaseCard from "../views/right_panel/BaseCard"; import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; @@ -46,13 +46,13 @@ export default class ThreadPanel extends React.Component { } public componentDidMount(): void { - this.room.on("Thread.update", this.onThreadEventReceived); - this.room.on("Thread.ready", this.onThreadEventReceived); + this.room.on(THREAD_EVENTS.update, this.onThreadEventReceived); + this.room.on(THREAD_EVENTS.ready, this.onThreadEventReceived); } public componentWillUnmount(): void { - this.room.removeListener("Thread.update", this.onThreadEventReceived); - this.room.removeListener("Thread.ready", this.onThreadEventReceived); + this.room.removeListener(THREAD_EVENTS.update, this.onThreadEventReceived); + this.room.removeListener(THREAD_EVENTS.ready, this.onThreadEventReceived); } private onThreadEventReceived = () => this.updateThreads(); diff --git a/src/components/structures/ThreadView.tsx b/src/components/structures/ThreadView.tsx index 614d3c9f4b..d6e10ce70e 100644 --- a/src/components/structures/ThreadView.tsx +++ b/src/components/structures/ThreadView.tsx @@ -16,7 +16,7 @@ limitations under the License. import React from 'react'; import { MatrixEvent, Room } from 'matrix-js-sdk/src'; -import { Thread } from 'matrix-js-sdk/src/models/thread'; +import { Thread, THREAD_EVENTS } from 'matrix-js-sdk/src/models/thread'; import BaseCard from "../views/right_panel/BaseCard"; import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; @@ -99,15 +99,15 @@ export default class ThreadView extends React.Component { thread = new Thread([mxEv], this.props.room, client); mxEv.setThread(thread); } - thread.on("Thread.update", this.updateThread); - thread.once("Thread.ready", this.updateThread); + thread.on(THREAD_EVENTS.update, this.updateThread); + thread.once(THREAD_EVENTS.ready, this.updateThread); this.updateThread(thread); }; private teardownThread = () => { if (this.state.thread) { - this.state.thread.removeListener("Thread.update", this.updateThread); - this.state.thread.removeListener("Thread.ready", this.updateThread); + this.state.thread.removeListener(THREAD_EVENTS.update, this.updateThread); + this.state.thread.removeListener(THREAD_EVENTS.ready, this.updateThread); } }; diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index cd4d7e39f2..782c1df323 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -21,7 +21,7 @@ import { EventType } from "matrix-js-sdk/src/@types/event"; import { EventStatus, MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Relations } from "matrix-js-sdk/src/models/relations"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; -import { Thread } from 'matrix-js-sdk/src/models/thread'; +import { Thread, THREAD_EVENTS } from 'matrix-js-sdk/src/models/thread'; import ReplyThread from "../elements/ReplyThread"; import { _t } from '../../../languageHandler'; @@ -464,8 +464,8 @@ export default class EventTile extends React.Component { } if (SettingsStore.getValue("feature_thread")) { - this.props.mxEvent.once("Thread.ready", this.updateThread); - this.props.mxEvent.on("Thread.update", this.updateThread); + this.props.mxEvent.once(THREAD_EVENTS.ready, this.updateThread); + this.props.mxEvent.on(THREAD_EVENTS.update, this.updateThread); } } From d6788b023bbf5e0828b01d15decfa40fc4f7abe2 Mon Sep 17 00:00:00 2001 From: Dariusz Niemczyk Date: Thu, 16 Sep 2021 16:04:18 +0200 Subject: [PATCH 4/5] Fix PR comments --- src/components/structures/ThreadPanel.tsx | 10 +++++----- src/components/structures/ThreadView.tsx | 10 +++++----- src/components/views/rooms/EventTile.tsx | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/structures/ThreadPanel.tsx b/src/components/structures/ThreadPanel.tsx index d9fd155c07..352ea59624 100644 --- a/src/components/structures/ThreadPanel.tsx +++ b/src/components/structures/ThreadPanel.tsx @@ -16,7 +16,7 @@ limitations under the License. import React from 'react'; import { MatrixEvent, Room } from 'matrix-js-sdk/src'; -import { Thread, THREAD_EVENTS } from 'matrix-js-sdk/src/models/thread'; +import { Thread, ThreadEvents } from 'matrix-js-sdk/src/models/thread'; import BaseCard from "../views/right_panel/BaseCard"; import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; @@ -46,13 +46,13 @@ export default class ThreadPanel extends React.Component { } public componentDidMount(): void { - this.room.on(THREAD_EVENTS.update, this.onThreadEventReceived); - this.room.on(THREAD_EVENTS.ready, this.onThreadEventReceived); + this.room.on(ThreadEvents.Update, this.onThreadEventReceived); + this.room.on(ThreadEvents.Ready, this.onThreadEventReceived); } public componentWillUnmount(): void { - this.room.removeListener(THREAD_EVENTS.update, this.onThreadEventReceived); - this.room.removeListener(THREAD_EVENTS.ready, this.onThreadEventReceived); + this.room.removeListener(ThreadEvents.Update, this.onThreadEventReceived); + this.room.removeListener(ThreadEvents.Ready, this.onThreadEventReceived); } private onThreadEventReceived = () => this.updateThreads(); diff --git a/src/components/structures/ThreadView.tsx b/src/components/structures/ThreadView.tsx index d6e10ce70e..a45648708f 100644 --- a/src/components/structures/ThreadView.tsx +++ b/src/components/structures/ThreadView.tsx @@ -16,7 +16,7 @@ limitations under the License. import React from 'react'; import { MatrixEvent, Room } from 'matrix-js-sdk/src'; -import { Thread, THREAD_EVENTS } from 'matrix-js-sdk/src/models/thread'; +import { Thread, ThreadEvents } from 'matrix-js-sdk/src/models/thread'; import BaseCard from "../views/right_panel/BaseCard"; import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; @@ -99,15 +99,15 @@ export default class ThreadView extends React.Component { thread = new Thread([mxEv], this.props.room, client); mxEv.setThread(thread); } - thread.on(THREAD_EVENTS.update, this.updateThread); - thread.once(THREAD_EVENTS.ready, this.updateThread); + thread.on(ThreadEvents.Update, this.updateThread); + thread.once(ThreadEvents.Ready, this.updateThread); this.updateThread(thread); }; private teardownThread = () => { if (this.state.thread) { - this.state.thread.removeListener(THREAD_EVENTS.update, this.updateThread); - this.state.thread.removeListener(THREAD_EVENTS.ready, this.updateThread); + this.state.thread.removeListener(ThreadEvents.Update, this.updateThread); + this.state.thread.removeListener(ThreadEvents.Ready, this.updateThread); } }; diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 782c1df323..4316fe8a89 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -21,7 +21,7 @@ import { EventType } from "matrix-js-sdk/src/@types/event"; import { EventStatus, MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Relations } from "matrix-js-sdk/src/models/relations"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; -import { Thread, THREAD_EVENTS } from 'matrix-js-sdk/src/models/thread'; +import { Thread, ThreadEvents } from 'matrix-js-sdk/src/models/thread'; import ReplyThread from "../elements/ReplyThread"; import { _t } from '../../../languageHandler'; @@ -464,8 +464,8 @@ export default class EventTile extends React.Component { } if (SettingsStore.getValue("feature_thread")) { - this.props.mxEvent.once(THREAD_EVENTS.ready, this.updateThread); - this.props.mxEvent.on(THREAD_EVENTS.update, this.updateThread); + this.props.mxEvent.once(ThreadEvents.Ready, this.updateThread); + this.props.mxEvent.on(ThreadEvents.Update, this.updateThread); } } From 0be6073058e27ddf463005ce75ec7d49d973254b Mon Sep 17 00:00:00 2001 From: Dariusz Niemczyk Date: Thu, 16 Sep 2021 17:13:41 +0200 Subject: [PATCH 5/5] Fix PR comments --- src/components/structures/ThreadPanel.tsx | 10 +++++----- src/components/structures/ThreadView.tsx | 10 +++++----- src/components/views/rooms/EventTile.tsx | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/structures/ThreadPanel.tsx b/src/components/structures/ThreadPanel.tsx index 352ea59624..ccf9d9d416 100644 --- a/src/components/structures/ThreadPanel.tsx +++ b/src/components/structures/ThreadPanel.tsx @@ -16,7 +16,7 @@ limitations under the License. import React from 'react'; import { MatrixEvent, Room } from 'matrix-js-sdk/src'; -import { Thread, ThreadEvents } from 'matrix-js-sdk/src/models/thread'; +import { Thread, ThreadEvent } from 'matrix-js-sdk/src/models/thread'; import BaseCard from "../views/right_panel/BaseCard"; import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; @@ -46,13 +46,13 @@ export default class ThreadPanel extends React.Component { } public componentDidMount(): void { - this.room.on(ThreadEvents.Update, this.onThreadEventReceived); - this.room.on(ThreadEvents.Ready, this.onThreadEventReceived); + this.room.on(ThreadEvent.Update, this.onThreadEventReceived); + this.room.on(ThreadEvent.Ready, this.onThreadEventReceived); } public componentWillUnmount(): void { - this.room.removeListener(ThreadEvents.Update, this.onThreadEventReceived); - this.room.removeListener(ThreadEvents.Ready, this.onThreadEventReceived); + this.room.removeListener(ThreadEvent.Update, this.onThreadEventReceived); + this.room.removeListener(ThreadEvent.Ready, this.onThreadEventReceived); } private onThreadEventReceived = () => this.updateThreads(); diff --git a/src/components/structures/ThreadView.tsx b/src/components/structures/ThreadView.tsx index a45648708f..dda4c06417 100644 --- a/src/components/structures/ThreadView.tsx +++ b/src/components/structures/ThreadView.tsx @@ -16,7 +16,7 @@ limitations under the License. import React from 'react'; import { MatrixEvent, Room } from 'matrix-js-sdk/src'; -import { Thread, ThreadEvents } from 'matrix-js-sdk/src/models/thread'; +import { Thread, ThreadEvent } from 'matrix-js-sdk/src/models/thread'; import BaseCard from "../views/right_panel/BaseCard"; import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; @@ -99,15 +99,15 @@ export default class ThreadView extends React.Component { thread = new Thread([mxEv], this.props.room, client); mxEv.setThread(thread); } - thread.on(ThreadEvents.Update, this.updateThread); - thread.once(ThreadEvents.Ready, this.updateThread); + thread.on(ThreadEvent.Update, this.updateThread); + thread.once(ThreadEvent.Ready, this.updateThread); this.updateThread(thread); }; private teardownThread = () => { if (this.state.thread) { - this.state.thread.removeListener(ThreadEvents.Update, this.updateThread); - this.state.thread.removeListener(ThreadEvents.Ready, this.updateThread); + this.state.thread.removeListener(ThreadEvent.Update, this.updateThread); + this.state.thread.removeListener(ThreadEvent.Ready, this.updateThread); } }; diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 4316fe8a89..5d8c083390 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -21,7 +21,7 @@ import { EventType } from "matrix-js-sdk/src/@types/event"; import { EventStatus, MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Relations } from "matrix-js-sdk/src/models/relations"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; -import { Thread, ThreadEvents } from 'matrix-js-sdk/src/models/thread'; +import { Thread, ThreadEvent } from 'matrix-js-sdk/src/models/thread'; import ReplyThread from "../elements/ReplyThread"; import { _t } from '../../../languageHandler'; @@ -464,8 +464,8 @@ export default class EventTile extends React.Component { } if (SettingsStore.getValue("feature_thread")) { - this.props.mxEvent.once(ThreadEvents.Ready, this.updateThread); - this.props.mxEvent.on(ThreadEvents.Update, this.updateThread); + this.props.mxEvent.once(ThreadEvent.Ready, this.updateThread); + this.props.mxEvent.on(ThreadEvent.Update, this.updateThread); } }