mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 12:21:13 +00:00
Fix bug where newly created communities cannot be edited until refresh (#2451)
* Fix bug where newly created communities cannot be edited until refresh * Fix bug with slightly less crappy kludge than before
This commit is contained in:
parent
b0a711a4ac
commit
17097ecd34
2 changed files with 7 additions and 2 deletions
|
@ -141,7 +141,7 @@
|
|||
"sortpack"
|
||||
]
|
||||
},
|
||||
"packageManager": "pnpm@9.0.6+sha256.0624e30eff866cdeb363b15061bdb7fd9425b17bc1bb42c22f5f4efdea21f6b3",
|
||||
"packageManager": "pnpm@9.1.0+sha512.67f5879916a9293e5cf059c23853d571beaf4f753c707f40cb22bed5fb1578c6aad3b6c4107ccb3ba0b35be003eb621a16471ac836c87beb53f9d54bb4612724",
|
||||
"engineStrict": true,
|
||||
"importSort": {
|
||||
".js, .jsx, .ts, .tsx": {
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
CreateCommunity as CreateCommunityI,
|
||||
GetSiteResponse,
|
||||
} from "lemmy-js-client";
|
||||
import { HttpService, I18NextService } from "../../services";
|
||||
import { HttpService, I18NextService, UserService } from "../../services";
|
||||
import { HtmlTags } from "../common/html-tags";
|
||||
import { CommunityForm } from "./community-form";
|
||||
import { simpleScrollMixin } from "../mixins/scroll-mixin";
|
||||
|
@ -68,6 +68,11 @@ export class CreateCommunity extends Component<
|
|||
const res = await HttpService.client.createCommunity(form);
|
||||
|
||||
if (res.state === "success") {
|
||||
const myUser = UserService.Instance.myUserInfo!;
|
||||
UserService.Instance.myUserInfo?.moderates.push({
|
||||
community: res.data.community_view.community,
|
||||
moderator: myUser.local_user_view.person,
|
||||
});
|
||||
const name = res.data.community_view.community.name;
|
||||
this.props.history.replace(`/c/${name}`);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue