Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private onItemClick = (id: string) => {
// 记住当前滚动位置
scrollTop = window.pageYOffset;
const url = `/photos/${id}`;
this.props.dispatch(routerActions.push(url));
};
private onSearchClose = () => {
const {dispatch, pathname} = this.props;
dispatch(routerActions.push(toUrl(pathname, {app: {showSearch: false}, messages: {search: {title: ""}}})));
};
onPress={() => {
if (!this.props.hasLogin) {
this.props.dispatch(errorAction(new UnauthorizedError()));
} else {
dispatch(routerActions.push("/messages#refresh=true"));
}
}}
/>
onPress={() => {
dispatch(routerActions.push(videosUrl));
}}
/>
private onShowSearch = () => {
const {pathname, showSearch, searchData, dispatch} = this.props;
const url = toUrl(pathname, {...searchData, app: {...searchData.app, showSearch: !showSearch}});
dispatch(routerActions.push(url));
};
private onSearchClose = () => {
const {dispatch, pathname} = this.props;
dispatch(routerActions.push(toUrl(pathname, {app: {showSearch: false}, photos: {search: {title: ""}}})));
};
onPress={() => {
dispatch(routerActions.push(photosUrl));
}}
/>
private onPageChange = (page: number) => {
const listSearch = {...this.props.listSearch, page};
const search = stringifyQuery("search", listSearch, defaultListSearch);
this.props.dispatch(routerActions.push(toUrl("/photos", search)));
};
private onSearch = (title: string) => {
private onClose = () => {
const listSearch = {...this.props.listSearch};
const search = stringifyQuery("search", listSearch, defaultListSearch);
this.props.dispatch(routerActions.push(toUrl("/photos", search)));
};
private onClose = () => {
const listSearch = {...this.props.listSearch};
const search = stringifyQuery("search", listSearch, defaultListSearch);
this.props.dispatch(routerActions.push(toUrl("/videos", search)));
};