Improve and consolidate typing
This commit is contained in:
parent
829169ec87
commit
bd175c6f40
21 changed files with 186 additions and 257 deletions
|
@ -20,6 +20,7 @@ import LabelledToggleSwitch from "../elements/LabelledToggleSwitch";
|
|||
import { _t } from "../../../languageHandler";
|
||||
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
import { Visibility } from "matrix-js-sdk/lib/@types/partials";
|
||||
|
||||
interface IProps {
|
||||
roomId: string;
|
||||
|
@ -49,7 +50,7 @@ export default class RoomPublishSetting extends React.PureComponent<IProps, ISta
|
|||
|
||||
client.setRoomDirectoryVisibility(
|
||||
this.props.roomId,
|
||||
newValue ? 'public' : 'private',
|
||||
newValue ? Visibility.Public : Visibility.Private,
|
||||
).catch(() => {
|
||||
// Roll back the local echo on the change
|
||||
this.setState({ isRoomPublished: valueBefore });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue