mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-22 06:36:14 +00:00
parent
b29f578e31
commit
bf601b0458
|
@ -136,7 +136,10 @@ impl Perform<GetCommunityResponse> for Oper<GetCommunity> {
|
|||
let community_id = match data.id {
|
||||
Some(id) => id,
|
||||
None => {
|
||||
Community::read_from_name(&conn, data.name.to_owned().unwrap_or("main".to_string()))?.id
|
||||
match Community::read_from_name(&conn, data.name.to_owned().unwrap_or("main".to_string())) {
|
||||
Ok(community) => community.id,
|
||||
Err(_e) => return Err(APIError::err(&self.op, "couldnt_find_community"))?,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
4
ui/src/components/community.tsx
vendored
4
ui/src/components/community.tsx
vendored
|
@ -25,7 +25,8 @@ import {
|
|||
fetchLimit,
|
||||
postRefetchSeconds,
|
||||
} from '../utils';
|
||||
import { T, i18n } from 'inferno-i18next';
|
||||
import { T } from 'inferno-i18next';
|
||||
import { i18n } from '../i18next';
|
||||
|
||||
interface State {
|
||||
community: CommunityI;
|
||||
|
@ -252,6 +253,7 @@ export class Community extends Component<any, State> {
|
|||
let op: UserOperation = msgOp(msg);
|
||||
if (msg.error) {
|
||||
alert(i18n.t(msg.error));
|
||||
this.context.router.history.push('/');
|
||||
return;
|
||||
} else if (op == UserOperation.GetCommunity) {
|
||||
let res: GetCommunityResponse = msg;
|
||||
|
|
Loading…
Reference in a new issue