Fix DesktopBuildsNotice return type

pull/21833/head
Germain Souquet 2021-06-22 10:26:49 +01:00
parent 7825c30bf7
commit 3d3c428455
3 changed files with 23 additions and 21 deletions

View File

@ -82,7 +82,6 @@ import SpaceRoomView from "./SpaceRoomView";
import { IOpts } from "../../createRoom"; import { IOpts } from "../../createRoom";
import { replaceableComponent } from "../../utils/replaceableComponent"; import { replaceableComponent } from "../../utils/replaceableComponent";
import UIStore from "../../stores/UIStore"; import UIStore from "../../stores/UIStore";
import Search from '../views/emojipicker/Search';
const DEBUG = false; const DEBUG = false;
let debuglog = function(msg: string) {}; let debuglog = function(msg: string) {};

View File

@ -18,7 +18,6 @@ import React from "react";
import EventIndexPeg from "../../../indexing/EventIndexPeg"; import EventIndexPeg from "../../../indexing/EventIndexPeg";
import { _t } from "../../../languageHandler"; import { _t } from "../../../languageHandler";
import SdkConfig from "../../../SdkConfig"; import SdkConfig from "../../../SdkConfig";
import dis from "../../../dispatcher/dispatcher"; import dis from "../../../dispatcher/dispatcher";
import { Action } from "../../../dispatcher/actions"; import { Action } from "../../../dispatcher/actions";
import { UserTab } from "../dialogs/UserSettingsDialog"; import { UserTab } from "../dialogs/UserSettingsDialog";
@ -39,15 +38,19 @@ export default function DesktopBuildsNotice({isRoomEncrypted, kind}: IProps) {
if (EventIndexPeg.get()) return null; if (EventIndexPeg.get()) return null;
if (EventIndexPeg.error) { if (EventIndexPeg.error) {
return _t("Message search initialisation failed, check <a>your settings</a> for more information", {}, { return <>
{_t("Message search initialisation failed, check <a>your settings</a> for more information", {}, {
a: sub => (<a onClick={(evt) => { a: sub => (<a onClick={(evt) => {
evt.preventDefault(); evt.preventDefault();
dis.dispatch({ dis.dispatch({
action: Action.ViewUserSettings, action: Action.ViewUserSettings,
initialTabId: UserTab.Security, initialTabId: UserTab.Security,
}); });
}}>{sub}</a>), }}>
}); {sub}
</a>),
})}
</>;
} }
const {desktopBuilds, brand} = SdkConfig.get(); const {desktopBuilds, brand} = SdkConfig.get();

View File

@ -50,15 +50,15 @@ export default class SearchBar extends React.Component<IProps, IState> {
}; };
} }
public onThisRoomClick = () => { private onThisRoomClick = () => {
this.setState({ scope: SearchScope.Room }, () => this._searchIfQuery()); this.setState({ scope: SearchScope.Room }, () => this.searchIfQuery());
}; };
public onAllRoomsClick = () => { private onAllRoomsClick = () => {
this.setState({ scope: SearchScope.All }, () => this._searchIfQuery()); this.setState({ scope: SearchScope.All }, () => this.searchIfQuery());
}; };
public onSearchChange = (e: React.KeyboardEvent) => { private onSearchChange = (e: React.KeyboardEvent) => {
switch (e.key) { switch (e.key) {
case Key.ENTER: case Key.ENTER:
this.onSearch(); this.onSearch();
@ -69,17 +69,17 @@ export default class SearchBar extends React.Component<IProps, IState> {
} }
}; };
_searchIfQuery() { private searchIfQuery(): void {
if (this.searchTerm.current.value) { if (this.searchTerm.current.value) {
this.onSearch(); this.onSearch();
} }
} }
onSearch = () => { private onSearch = (): void => {
this.props.onSearch(this.searchTerm.current.value, this.state.scope); this.props.onSearch(this.searchTerm.current.value, this.state.scope);
}; };
render() { public render() {
const searchButtonClasses = classNames("mx_SearchBar_searchButton", { const searchButtonClasses = classNames("mx_SearchBar_searchButton", {
mx_SearchBar_searching: this.props.searchInProgress, mx_SearchBar_searching: this.props.searchInProgress,
}); });