From 8cb4454ea3a218c7734d2479b0f5d0bf07e00c6b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 8 Oct 2021 13:43:06 +0100 Subject: [PATCH] Disable leave room button if user isn't in the room e.g peeking --- .../settings/tabs/room/GeneralRoomSettingsTab.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx index 790e2999f5..37ac358660 100644 --- a/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React from 'react'; +import React, { ContextType } from 'react'; import { _t } from "../../../../../languageHandler"; import RoomProfileSettings from "../../../room_settings/RoomProfileSettings"; import AccessibleButton from "../../../elements/AccessibleButton"; @@ -38,9 +38,10 @@ interface IState { @replaceableComponent("views.settings.tabs.room.GeneralRoomSettingsTab") export default class GeneralRoomSettingsTab extends React.Component { public static contextType = MatrixClientContext; + context: ContextType; - constructor(props: IProps) { - super(props); + constructor(props: IProps, context: ContextType) { + super(props, context); this.state = { isRoomPublished: false, // loaded async @@ -111,7 +112,11 @@ export default class GeneralRoomSettingsTab extends React.Component{ _t("Leave room") }
- + { _t('Leave room') }